def test_to_json_schema(self): obj = obj_base.SenlinObject() expected = { '$schema': 'http://json-schema.org/draft-04/schema#', 'title': 'SenlinObject' } self.assertEqual(expected, obj.to_json_schema())
def test_from_db_object_none(self): obj = obj_base.SenlinObject() db_obj = None context = mock.Mock() res = obj_base.SenlinObject._from_db_object(context, obj, db_obj) self.assertIsNone(res)
def test_base_class(self): obj = obj_base.SenlinObject() self.assertEqual(obj_base.SenlinObject.OBJ_PROJECT_NAMESPACE, obj.OBJ_PROJECT_NAMESPACE) self.assertEqual(obj_base.SenlinObject.VERSION, obj.VERSION)
def test_to_json_schema(self): obj = obj_base.SenlinObject() self.assertRaises(exc.UnsupportedObjectError, obj.to_json_schema)