Beispiel #1
0
    def test_default_chain(self):
        s = SchemaNode()
        s.key = "root"
        s.add_title("root", "en", primary=True)
        s.add_title("שורש", "he", primary=True)
        s.add_title("alt root", "en")

        s2 = SchemaNode()
        s2.key = "default"
        s2.default = True
        s2.append_to(s)

        j = JaggedArrayNode()
        j.key = "default"
        j.depth = 1
        j.default = True
        j.sectionNames = ["Foo"]
        j.addressTypes = ["Integer"]
        j.append_to(s2)

        s.validate()

        assert s.has_numeric_continuation()
        assert s2.has_numeric_continuation()
        assert j.has_numeric_continuation()
        assert not s.has_titled_continuation()
        assert not s2.has_titled_continuation()
        assert not j.has_titled_continuation()
    def test_default_chain(self):
        s = SchemaNode()
        s.key = "root"
        s.add_title("root", "en", primary=True)
        s.add_title("alt root", "en")

        s2 = SchemaNode()
        s2.key = "default"
        s2.default = True
        s2.append_to(s)

        j = JaggedArrayNode()
        j.key = "default"
        j.depth = 1
        j.default = True
        j.sectionNames = ["Foo"]
        j.addressTypes = ["Integer"]
        j.append_to(s2)

        s.validate()

        assert s.has_numeric_continuation()
        assert s2.has_numeric_continuation()
        assert j.has_numeric_continuation()
        assert not s.has_titled_continuation()
        assert not s2.has_titled_continuation()
        assert not j.has_titled_continuation()