コード例 #1
0
 def test_network_update(self):
     network = dbapi.networks_create(self.context, network1)
     res = dbapi.networks_get_by_id(self.context, network.id)
     self.assertEqual(res.name, 'test network')
     new_name = 'test_network1'
     res = dbapi.networks_update(self.context, res.id,
                                 {'name': 'test_network1'})
     self.assertEqual(res.name, new_name)
コード例 #2
0
 def test_networks_delete(self):
     network = dbapi.networks_create(self.context, network1)
     # First make sure we have the network created
     res = dbapi.networks_get_by_id(self.context, network.id)
     self.assertEqual(res.id, network.id)
     # Delete the network
     dbapi.networks_delete(self.context, res.id)
     self.assertRaises(exceptions.NotFound, dbapi.networks_get_by_id,
                       self.context, res.id)
コード例 #3
0
ファイル: test_networks.py プロジェクト: sigmavirus24/craton
 def test_networks_delete(self):
     network = dbapi.networks_create(self.context, network1)
     # First make sure we have the network created
     res = dbapi.networks_get_by_id(self.context, network.id)
     self.assertEqual(res.id, network.id)
     # Delete the network
     dbapi.networks_delete(self.context, res.id)
     self.assertRaises(exceptions.NotFound, dbapi.networks_get_by_id,
                       self.context, res.id)
コード例 #4
0
 def test_networks_get_by_id(self):
     network = dbapi.networks_create(self.context, network1)
     res = dbapi.networks_get_by_id(self.context, network.id)
     self.assertEqual(res.name, 'test network')
コード例 #5
0
ファイル: test_networks.py プロジェクト: sigmavirus24/craton
 def test_networks_get_by_id(self):
     network = dbapi.networks_create(self.context, network1)
     res = dbapi.networks_get_by_id(self.context, network.id)
     self.assertEqual(res.name, 'test network')