Exemple #1
0
 def test_cell_update(self):
     dbapi.cells_create(self.context, cell1)
     res = dbapi.cells_get_by_name(self.context, cell1['region_id'],
                                   cell1['name'])
     self.assertEqual(res.name, 'cell1')
     new_name = 'cell1_New'
     res = dbapi.cells_update(self.context, res.id, {'name': 'cell1_New'})
     self.assertEqual(res.name, new_name)
Exemple #2
0
 def test_cell_data_update_does_create_variables(self):
     dbapi.cells_create(self.context, cell1)
     res = dbapi.cells_get_by_name(self.context, cell1['region_id'],
                                   cell1['name'])
     self.assertEqual(res.variables, {})
     variables = {"key1": "value1", "key2": "value2"}
     res = dbapi.cells_data_update(self.context, res.id, variables)
     self.assertEqual(res.variables, variables)
Exemple #3
0
 def test_cell_data_update_does_create_variables(self):
     dbapi.cells_create(self.context, cell1)
     res = dbapi.cells_get_by_name(self.context, cell1['region_id'],
                                   cell1['name'])
     self.assertEqual(res.variables, {})
     variables = {"key1": "value1", "key2": "value2"}
     res = dbapi.cells_data_update(self.context, res.id, variables)
     self.assertEqual(res.variables, variables)
Exemple #4
0
    def test_cell_delete(self):
        dbapi.cells_create(self.context, cell1)
        # First make sure we have the cell
        res = dbapi.cells_get_by_name(self.context, cell1['region_id'],
                                      cell1['name'])
        self.assertEqual(res.name, 'cell1')

        dbapi.cells_delete(self.context, res.id)
        self.assertRaises(exceptions.NotFound, dbapi.cells_get_by_name,
                          self.context, 'fake-region', 'fake-cell')
Exemple #5
0
    def test_cell_delete(self):
        dbapi.cells_create(self.context, cell1)
        # First make sure we have the cell
        res = dbapi.cells_get_by_name(self.context, cell1['region_id'],
                                      cell1['name'])
        self.assertEqual(res.name, 'cell1')

        dbapi.cells_delete(self.context, res.id)
        self.assertRaises(exceptions.NotFound, dbapi.cells_get_by_name,
                          self.context, 'fake-region', 'fake-cell')
Exemple #6
0
 def test_cell_data_delete(self):
     dbapi.cells_create(self.context, cell1)
     res = dbapi.cells_get_by_name(self.context, cell1['region_id'],
                                   cell1['name'])
     self.assertEqual(res.variables, {})
     variables = {"key1": "value1", "key2": "value2"}
     res = dbapi.cells_data_update(self.context, res.id, variables)
     self.assertEqual(res.variables, variables)
     # NOTE(sulo): we delete variables by their key
     res = dbapi.cells_data_delete(self.context, res.id, {"key1": "key1"})
     self.assertEqual(res.variables, {"key2": "value2"})
Exemple #7
0
 def test_cell_data_delete(self):
     dbapi.cells_create(self.context, cell1)
     res = dbapi.cells_get_by_name(self.context, cell1['region_id'],
                                   cell1['name'])
     self.assertEqual(res.variables, {})
     variables = {"key1": "value1", "key2": "value2"}
     res = dbapi.cells_data_update(self.context, res.id, variables)
     self.assertEqual(res.variables, variables)
     # NOTE(sulo): we delete variables by their key
     res = dbapi.cells_data_delete(self.context, res.id, {"key1": "key1"})
     self.assertEqual(res.variables, {"key2": "value2"})
Exemple #8
0
 def test_cell_get_by_name(self):
     dbapi.cells_create(self.context, cell1)
     res = dbapi.cells_get_by_name(self.context, cell1['region_id'],
                                   cell1['name'])
     self.assertEqual(res.name, 'cell1')
Exemple #9
0
 def test_cell_get_by_name(self):
     dbapi.cells_create(self.context, cell1)
     res = dbapi.cells_get_by_name(self.context, cell1['region_id'],
                                   cell1['name'])
     self.assertEqual(res.name, 'cell1')