Beispiel #1
0
 def test_region_data_update_does_create_variables(self):
     dbapi.regions_create(self.context, region1)
     res = dbapi.regions_get_by_name(self.context, region1['name'])
     self.assertEqual(res.variables, {})
     variables = {"key1": "value1", "key2": "value2"}
     res = dbapi.regions_data_update(self.context, res.id, variables)
     self.assertEqual(res.variables, variables)
Beispiel #2
0
 def test_region_data_update_does_create_variables(self):
     dbapi.regions_create(self.context, region1)
     res = dbapi.regions_get_by_name(self.context, region1['name'])
     self.assertEqual(res.variables, {})
     variables = {"key1": "value1", "key2": "value2"}
     res = dbapi.regions_data_update(self.context, res.id, variables)
     self.assertEqual(res.variables, variables)
Beispiel #3
0
    def test_region_delete(self):
        dbapi.regions_create(self.context, region1)
        # First make sure we have the region
        res = dbapi.regions_get_by_name(self.context, region1['name'])
        self.assertEqual(res.name, 'region1')

        dbapi.regions_delete(self.context, res.id)
        self.assertRaises(exceptions.NotFound, dbapi.regions_get_by_name,
                          self.context, 'fake-region')
Beispiel #4
0
 def test_region_data_delete(self):
     dbapi.regions_create(self.context, region1)
     res = dbapi.regions_get_by_name(self.context, region1['name'])
     self.assertEqual(res.variables, {})
     variables = {"key1": "value1", "key2": "value2"}
     res = dbapi.regions_data_update(self.context, res.id, variables)
     self.assertEqual(res.variables, variables)
     # NOTE(sulo): we delete variables by their key
     res = dbapi.regions_data_delete(self.context, res.id, {"key1": "key1"})
     self.assertEqual(res.variables, {"key2": "value2"})
Beispiel #5
0
 def test_region_data_delete(self):
     dbapi.regions_create(self.context, region1)
     res = dbapi.regions_get_by_name(self.context, region1['name'])
     self.assertEqual(res.variables, {})
     variables = {"key1": "value1", "key2": "value2"}
     res = dbapi.regions_data_update(self.context, res.id, variables)
     self.assertEqual(res.variables, variables)
     # NOTE(sulo): we delete variables by their key
     res = dbapi.regions_data_delete(self.context, res.id, {"key1": "key1"})
     self.assertEqual(res.variables, {"key2": "value2"})
Beispiel #6
0
    def test_region_delete(self):
        dbapi.regions_create(self.context, region1)
        # First make sure we have the region
        res = dbapi.regions_get_by_name(self.context, region1['name'])
        self.assertEqual(res.name, 'region1')

        dbapi.regions_delete(self.context, res.id)
        self.assertRaises(exceptions.NotFound,
                          dbapi.regions_get_by_name,
                          self.context, 'fake-region')
Beispiel #7
0
 def test_region_get_by_name(self):
     dbapi.regions_create(self.context, region1)
     res = dbapi.regions_get_by_name(self.context, region1['name'])
     self.assertEqual(res.name, 'region1')
Beispiel #8
0
 def test_region_get_by_name(self):
     dbapi.regions_create(self.context, region1)
     res = dbapi.regions_get_by_name(self.context, region1['name'])
     self.assertEqual(res.name, 'region1')