Пример #1
0
    def setUp(self):
        super(TestDummyObject, self).setUp()

        @base.base.VersionedObjectRegistry.register
        class TestableObject(base.base.VersionedObject):
            fields = {}

        self.field = fields.Field(senlin_fields.Object('TestableObject'))
Пример #2
0
    def to_json_schema(cls):
        obj_name = cls.obj_name()
        schema = {
            '$schema': 'http://json-schema.org/draft-04/schema#',
            'title': obj_name,
        }

        schema.update(fields.Object(obj_name).get_schema())
        return schema
Пример #3
0
    def setUp(self):
        super(TestObject, self).setUp()

        @base.base.VersionedObjectRegistry.register
        class TestableObject(base.base.VersionedObject):
            fields = {
                'uuid': fields.StringField(),
            }

        test_inst = TestableObject()
        self._test_cls = TestableObject
        self.field = fields.Field(senlin_fields.Object('TestableObject'))
        self.coerce_good_values = [(test_inst, test_inst)]
        self.coerce_bad_values = [1, 'foo']
        self.to_primitive_values = [(test_inst, test_inst.obj_to_primitive())]
        self.from_primitive_values = [(test_inst.obj_to_primitive(),
                                       test_inst), (test_inst, test_inst)]