gce/ex_create_address: Test two error cases
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/060e081d Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/060e081d Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/060e081d Branch: refs/heads/trunk Commit: 060e081d994a35f2374557a9c362e331d063c4e2 Parents: 4d3e959 Author: Quentin Pradet <[email protected]> Authored: Sat Feb 24 22:57:57 2018 +0400 Committer: Quentin Pradet <[email protected]> Committed: Sun Feb 25 09:01:25 2018 +0400 ---------------------------------------------------------------------- libcloud/test/compute/test_gce.py | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/060e081d/libcloud/test/compute/test_gce.py ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py index e04cc93..f43cb4d 100644 --- a/libcloud/test/compute/test_gce.py +++ b/libcloud/test/compute/test_gce.py @@ -746,6 +746,14 @@ class GCENodeDriverTest(GoogleTestCase, TestCaseMixin): self.assertEqual(address.name, address_name) self.assertEqual(address.address, '10.128.0.12') + self.assertRaises(ValueError, + self.driver.ex_create_address, + address_name, address_type='WRONG') + self.assertRaises(ValueError, + self.driver.ex_create_address, + address_name, address_type='EXTERNAL', + subnetwork='subnet-1') + def test_ex_create_backend(self): # Note: this is an internal object, no API call is made # and no fixture is needed specifically for GCEBackend, however
