Kaynağa Gözat

Add a test for GETting a subnet

Enis Afgan 10 yıl önce
ebeveyn
işleme
4cca889174
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  1. 5 0
      test/test_network_service.py

+ 5 - 0
test/test_network_service.py

@@ -46,6 +46,11 @@ class CloudNetworkServiceTestCase(ProviderTestBase):
                     len(list_subnetl) == 1,
                     len(list_subnetl) == 1,
                     "List subnets does not return the expected subnet %s" %
                     "List subnets does not return the expected subnet %s" %
                     subnet_name)
                     subnet_name)
+                # test get method
+                sn = self.provider.network.subnets.get(subnet.id)
+                self.assertTrue(
+                    subnet.id == sn.id,
+                    "GETting subnet should return the same subnet")
 
 
             subnetl = self.provider.network.subnets.list()
             subnetl = self.provider.network.subnets.list()
             found_subnet = [n for n in subnetl if n.name == subnet_name]
             found_subnet = [n for n in subnetl if n.name == subnet_name]