Beispiel #1
0
 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())
Beispiel #2
0
    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)
Beispiel #3
0
 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)
Beispiel #4
0
 def test_to_json_schema(self):
     obj = obj_base.SenlinObject()
     self.assertRaises(exc.UnsupportedObjectError, obj.to_json_schema)