|
| 1 | +#!/usr/bin/env python |
| 2 | +# Copyright (C) 2013 Yahoo! Inc. |
| 3 | +# All Rights Reserved. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | +# not use this file except in compliance with the License. You may obtain |
| 7 | +# a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | +# License for the specific language governing permissions and limitations |
| 15 | +# under the License. |
| 16 | +# vim: tabstop=4 shiftwidth=4 softtabstop=4 |
| 17 | + |
| 18 | +import sys |
| 19 | + |
| 20 | +from quantumclient.common import exceptions |
| 21 | +from quantumclient.quantum.v2_0 import quota as test_quota |
| 22 | +from quantumclient.tests.unit import test_cli20 |
| 23 | + |
| 24 | + |
| 25 | +class CLITestV20Quota(test_cli20.CLITestV20Base): |
| 26 | + def test_show_quota(self): |
| 27 | + resource = 'quota' |
| 28 | + cmd = test_quota.ShowQuota( |
| 29 | + test_cli20.MyApp(sys.stdout), None) |
| 30 | + args = ['--tenant-id', self.test_id] |
| 31 | + self._test_show_resource(resource, cmd, self.test_id, args) |
| 32 | + |
| 33 | + def test_update_quota(self): |
| 34 | + resource = 'quota' |
| 35 | + cmd = test_quota.UpdateQuota( |
| 36 | + test_cli20.MyApp(sys.stdout), None) |
| 37 | + args = ['--tenant-id', self.test_id, '--network', 'test'] |
| 38 | + self.assertRaises( |
| 39 | + exceptions.QuantumClientException, self._test_update_resource, |
| 40 | + resource, cmd, self.test_id, args=args, |
| 41 | + extrafields={'network': 'new'}) |
| 42 | + |
| 43 | + def test_delete_quota_get_parser(self): |
| 44 | + cmd = test_cli20.MyApp(sys.stdout) |
| 45 | + test_quota.DeleteQuota(cmd, None).get_parser(cmd) |
0 commit comments