Skip to content

Commit 77df9c4

Browse files
committed
[test-property] Add Test for Leaf-Export
1 parent a165153 commit 77df9c4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/test_property.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,34 @@ def test_comparison(self):
733733
prop_b.name = 'newPropertyName'
734734
self.assertNotEqual(prop_a, prop_b)
735735

736+
def test_export_leaf(self):
737+
doc = Document()
738+
first = doc.create_section("first")
739+
second = first.create_section("second")
740+
first.create_section("third")
741+
742+
name = "prop1"
743+
values = [1.3]
744+
first.create_property(name, value=values)
745+
746+
name = "prop2"
747+
values = ["words"]
748+
second.create_property(name, value=values)
749+
750+
name = "prop3"
751+
values = ["a", "b"]
752+
second.create_property(name, value=values)
753+
754+
name = "prop4"
755+
values = [3]
756+
second.create_property(name, value=values)
757+
758+
ex = second.properties["prop2"].export_leaf()
759+
self.assertEqual(len(ex.sections), 1)
760+
self.assertEqual(len(ex['first'].properties), 0)
761+
self.assertEqual(len(ex['first'].sections), 1)
762+
self.assertEqual(len(ex['first']['second'].properties), 1)
763+
736764

737765
if __name__ == "__main__":
738766
print("TestProperty")

0 commit comments

Comments
 (0)