Ejemplo n.º 1
0
 def test_region_data_update_does_update_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)
     new_variables = {"key1": "tom", "key2": "cat"}
     res = dbapi.regions_data_update(self.context, res.id, new_variables)
     self.assertEqual(res.variables, new_variables)
Ejemplo n.º 2
0
 def test_region_data_update_does_update_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)
     new_variables = {"key1": "tom", "key2": "cat"}
     res = dbapi.regions_data_update(self.context, res.id, new_variables)
     self.assertEqual(res.variables, new_variables)
Ejemplo n.º 3
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"})
Ejemplo n.º 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"})