def test_get_instance_with_id_as_none(self): models = SQLStore.get_service_instance(instance_id=None) self.assertNotEqual(models, [])
def test_get_instance_with_id(self): models = SQLStore.get_service_instance(instance_id=self.id_name) self.assertGreater(len(models), 0) self.assertIsInstance(models[0], ServiceInstance)
def test_get_instance_with_id_and_not_found(self, mock_exists_in_db): mock_exists_in_db.return_value = False models = SQLStore.get_service_instance(self.id_name) self.assertEqual(models, [])
def test_get_instance_with_instance_id(self): result = SQLStore.get_service_instance(instance_id=self.id_name) self.assertGreater(len(result), 0) self.assertIsInstance(result[0], ServiceInstance)