Exemplo n.º 1
0
    def test_buildPagesofType2(self):
        cmods, omods, pmods = build_tester_tree()
        root1 = buildTree(cmods, omods, pmods)[0]
        root2 = buildTree(cmods, omods, pmods)[0]
        buildPagesofType(root1, "crisis", cmods, buildCrisisPage)

        self.assert_(root1 != root2)
Exemplo n.º 2
0
 def test_buildCommonData(self):
     cmods, omods, pmods = build_tester_tree()
     root = buildTree(cmods, omods, pmods)[2]
     SubElement(root, "crisis")
     elements = buildCommonData(root[0], cmods[0])
     for element in elements:
         root[0].append(element)
     self.assert_(len(root[0]) == 11)
     self.assert_(root[0][0] == "n")
Exemplo n.º 3
0
    def test_buildPersonPage3(self):
        cmods, omods, pmods = build_tester_tree()
        root = buildTree(cmods, omods, pmods)[2]
        SubElement(root, "Person")
        elements = buildPersonPage(root[0], pmods[0])
        for element in elements:
            root[0].append(element)

        self.assert_(root[0][len(root[0]) - 1][0] == "p1")
Exemplo n.º 4
0
    def test_buildOrganizationPage2(self):
        cmods, omods, pmods = build_tester_tree()
        root = buildTree(cmods, omods, pmods)[1]
        SubElement(root, "Organization")
        elements = buildOrgPage(root[0], omods[0])
        for element in elements:
            root[0].append(element)

        self.assert_(root[0][0] == "n")
Exemplo n.º 5
0
    def test_buildCrisisPage3(self):
        cmods, omods, pmods = build_tester_tree()
        root = buildTree(cmods, omods, pmods)[0]
        SubElement(root, "crisis")
        elements = buildCrisisPage(root[0], cmods[0])
        for element in elements:
            root[0].append(element)

        self.assert_(root[0][len(root[0]) - 1] == "p1")
Exemplo n.º 6
0
    def test_buildPagesofType4(self):
        cmods, omods, pmods = build_tester_tree()
        root1 = buildTree(cmods, omods, pmods)[2]
        root2 = buildTree(cmods, omods, pmods)[2]
        buildPagesofType(root1, "person", pmods, buildPersonPage)

        for x in range(len(pmods)):
            SubElement(root2, "person")
            elements = buildPersonPage(root2[x], pmods[x])

            # add sub elements
            for element in elements:
                root2[x].append(element)

        self.assert_(root1 == root2)
Exemplo n.º 7
0
    def test_buildPagesofType3(self):
        cmods, omods, pmods = build_tester_tree()
        root1 = buildTree(cmods, omods, pmods)[1]
        root2 = buildTree(cmods, omods, pmods)[1]
        buildPagesofType(root1, "organization", omods, buildOrgPage)

        for x in range(len(omods)):
            SubElement(root2, "organization")
            elements = buildOrgPage(root2[x], omods[x])

            # add sub elements
            for element in elements:
                root2[x].append(element)

        self.assert_(root1 == root2)
Exemplo n.º 8
0
    def test_buildPagesofType1(self):
        cmods, omods, pmods = build_tester_tree()
        root1 = buildTree(cmods, omods, pmods)[0]
        root2 = buildTree(cmods, omods, pmods)[0]
        buildPagesofType(root1, "crisis", cmods, buildCrisisPage)

        for x in range(len(cmods)):
            SubElement(root2, "crisis")
            elements = buildCrisisPage(root2[x], cmods[x])

            # add sub elements
            for element in elements:
                root2[x].append(element)

        self.assert_(root1 == root2)
Exemplo n.º 9
0
 def test_build_tree3(self):
     cmods, omods, pmods = build_tester_tree()
     root = buildTree(cmods, omods, pmods)
     self.assert_(len(root[0]) == 5)
     self.assert_(len(root[1]) == 5)
     self.assert_(len(root[2]) == 5)
Exemplo n.º 10
0
 def test_build_tree2(self):
     try:
         cmods, omods, pmods = build_tester_tree()
         root = buildTree(cmods, omods, pmods)
     except Exception:
         self.assert_(False)