Example #1
0
    def test_objectArray(self):
        object = ObjectArray()
        object.name = "a"
        object.sample_count = 1
        object.type = Object.Types.array

        object2 = ObjectArray()
        object2.name = "b"
        object2.type = Object.Types.array

        object.items = object2

        object_sample = ObjectArraySample(object)

        self.assertEqual("a", object_sample.name)
        self.assertEqual(1, object_sample.sample_count)
        self.assertIsInstance(object_sample.items, ObjectArraySample)
Example #2
0
    def test_objectArray(self):
        object = ObjectArray()
        object.name = "a"
        object.sample_count = 1
        object.type = Object.Types.array

        object2 = ObjectArray()
        object2.name = "b"
        object2.type = Object.Types.array

        object.items = object2

        object_sample = ObjectArraySample(object)

        self.assertEqual("a", object_sample.name)
        self.assertEqual(1, object_sample.sample_count)
        self.assertIsInstance(object_sample.items, ObjectArraySample)
Example #3
0
    def test_objectObject(self):
        object = ObjectObject()
        object.name = "a"
        object.type = Object.Types.object

        object2 = ObjectArray()
        object2.name = "b"
        object2.type = Object.Types.array

        object.properties = {"b": object2}

        object_sample = ObjectObjectSample(object)

        self.assertEqual("a", object_sample.name)
        self.assertIsInstance(object_sample.properties, dict)
        self.assertEqual(1, len(object_sample.properties))
        self.assertIsInstance(object_sample.properties["b"], ObjectArraySample)
Example #4
0
    def test_objectObject(self):
        object = ObjectObject()
        object.name = "a"
        object.type = Object.Types.object

        object2 = ObjectArray()
        object2.name = "b"
        object2.type = Object.Types.array

        object.properties = {"b": object2}

        object_sample = ObjectObjectSample(object)

        self.assertEqual("a", object_sample.name)
        self.assertIsInstance(object_sample.properties, dict)
        self.assertEqual(1, len(object_sample.properties))
        self.assertIsInstance(object_sample.properties["b"], ObjectArraySample)