Prechádzať zdrojové kódy

Update tests for inet gtw sig update and update exceptions wording

Enis Afgan 8 rokov pred
rodič
commit
fbec471a7c

+ 12 - 10
cloudbridge/cloud/base/resources.py

@@ -454,29 +454,31 @@ class BaseLaunchConfig(LaunchConfig):
         InvalidConfigurationException if the configuration is incorrect.
         """
         if source is None and not size:
-            log.exception("Raised InvalidConfigurationException, no"
-                          " size argument specified.")
+            log.exception("InvalidConfigurationException raised: "
+                          "no size argument specified.")
             raise InvalidConfigurationException(
-                "A size must be specified for a blank new volume")
+                "A size must be specified for a blank new volume.")
 
         if source and \
                 not isinstance(source, (Snapshot, Volume, MachineImage)):
-            log.exception("InvalidConfigurationException raised, "
+            log.exception("InvalidConfigurationException raised: "
                           "source argument not specified correctly.")
             raise InvalidConfigurationException(
-                "Source must be a Snapshot, Volume, MachineImage or None")
+                "Source must be a Snapshot, Volume, MachineImage, or None.")
         if size:
             if not isinstance(size, six.integer_types) or not size > 0:
-                log.exception("InvalidConfigurationException raised, "
-                              " size argument must be greater than 0.")
+                log.exception("InvalidConfigurationException raised: "
+                              "size argument must be an integer greater than "
+                              "0. Got type %s and value %s.", type(size), size)
                 raise InvalidConfigurationException(
-                    "The size must be None or a number greater than 0")
+                    "The size must be None or an integer greater than 0.")
 
         if is_root:
             for bd in self.block_devices:
                 if bd.is_root:
-                    log.exception("InvalidConfigurationException raised,"
-                                  "%s has already been marked as root", bd)
+                    log.exception("InvalidConfigurationException raised: "
+                                  "%s has already been marked as the root "
+                                  "block device.", bd)
                     raise InvalidConfigurationException(
                         "An existing block device: {0} has already been"
                         " marked as root. There can only be one root device.")

+ 1 - 1
test/test_compute_service.py

@@ -344,7 +344,7 @@ class CloudComputeServiceTestCase(ProviderTestBase):
                                                                gateway)):
                 router.attach_subnet(subnet)
                 gateway = (self.provider.networking.gateways
-                           .get_or_create_inet_gateway(name))
+                           .get_or_create_inet_gateway(net, name))
                 router.attach_gateway(gateway)
                 # check whether adding an elastic ip works
                 fip = self.provider.networking.floating_ips.create()

+ 1 - 1
test/test_network_service.py

@@ -167,7 +167,7 @@ class CloudNetworkServiceTestCase(ProviderTestBase):
 
             router.attach_subnet(sn)
             gteway = (self.provider.networking.gateways
-                      .get_or_create_inet_gateway(name))
+                      .get_or_create_inet_gateway(net, name))
             router.attach_gateway(gteway)
             # TODO: add a check for routes after that's been implemented