def test_service_create_get(self): service = self._create_service() ret_service = db_api.service_get(self.ctxt, service.id) self.assertIsNotNone(ret_service) self.assertEqual(service.id, ret_service.id) self.assertEqual(service.binary, ret_service.binary) self.assertEqual(service.host, ret_service.host) self.assertEqual(service.topic, ret_service.topic) self.assertEqual(service.disabled, ret_service.disabled) self.assertEqual(service.disabled_reason, ret_service.disabled_reason) self.assertIsNotNone(service.created_at) self.assertIsNotNone(service.updated_at)
def test_service_delete(self): service = self._create_service() db_api.service_delete(self.ctxt, service.id) res = db_api.service_get(self.ctxt, service.id) self.assertIsNone(res)