def test_definition_healthy(self):
        abstract_obj = AbstractObject()
        abstract_obj.id = 1

        assert_that(abstract_obj, not_(equal_to(None)))
        assert_that(abstract_obj.definition, equal_to({'id': 1, 'type': 'common'}))
        assert_that(abstract_obj.definition_healthy, equal_to(True))
Example #2
0
    def test_basic(self):
        abstract_obj = AbstractObject()

        assert_that(abstract_obj, not_(equal_to(None)))
        assert_that(abstract_obj.definition, equal_to({'id': None, 'type': 'common'}))
        assert_that(abstract_obj.definition_hash, has_length(64))
        assert_that(abstract_obj.hash(abstract_obj.definition), equal_to(abstract_obj.definition_hash))
        assert_that(abstract_obj.hash_local(1,2,3), has_length(64))
        assert_that(abstract_obj.local_id, equal_to(None))
    def test_definition_healthy(self):
        abstract_obj = AbstractObject()
        abstract_obj.id = 1

        assert_that(abstract_obj, not_(equal_to(None)))
        assert_that(abstract_obj.definition,
                    equal_to({
                        'id': 1,
                        'type': 'common'
                    }))
        assert_that(abstract_obj.definition_healthy, equal_to(True))
Example #4
0
 def __init__(self, object=None, config=None, filters=None):
     self.definition = object
     self.id = AbstractObject.hash(self.definition)
     self.type = self.definition.get('type')
     self.config = config if config else {}
     self.config['filters'] = filters or []
Example #5
0
 def __init__(self, object=None, config=None, filters=None):
     self.definition = object
     self.id = AbstractObject.hash(self.definition)
     self.type = self.definition.get('type')
     self.config = config if config else {}
     self.config['filters'] = filters or []