Esempio n. 1
0
 def test_parse2(self):
     xml_file = open("test/test_parse2.xml", 'rb')
     XMLHelpers.parseXML2(xml_file,{'check': False, 'merge' : False})
     temp = db.GqlQuery("SELECT * FROM Link")
     for i in temp:
         if i.link_type == "image":
             self.assertEqual(i.link_url, "asdfasdfsadf")
             break
     db.delete(db.Query())        
Esempio n. 2
0
 def test_parse4(self):
     xml_file = open("test/test_parse4.xml", 'rb')
     XMLHelpers.parseXML2(xml_file,{'check': False, 'merge' : False})
     temp = db.GqlQuery("SELECT * FROM Link")
     for i in temp:
         if i.link_type == "image":
             assert i.link_url == "aaaa"
             break
     db.delete(db.Query())
Esempio n. 3
0
 def test_parse1(self):
     xml_file = open("test/test_parse1.xml", 'rb')
     XMLHelpers.parseXML2(xml_file,{'check': False, 'merge' : False})
     temp = db.GqlQuery("SELECT * FROM Link")
     for i in temp:
         if i.link_type == "image":
             self.assert_(i.link_url == "https://www.google.com")
             break
     db.delete(db.Query())   
    def test_mergeLinks2(self):
        xml_file = open("test/test_mergelinks2.xml", 'rb')
        XMLHelpers.parseXML2(xml_file,{'check': False, 'merge' : False})
        xml_file = open("test/test_mergelinks4.xml", 'rb')
        XMLHelpers.parseXML2(xml_file,{'check': False, 'merge' : True})
        temp = db.GqlQuery("SELECT * FROM Link")
        
        #Stuff

        db.delete(db.Query())
    def test_mergeLinks3(self):
        xml_file = open("test/test_mergelinks1.xml", 'rb')
        XMLHelpers.parseXML2(xml_file,{'check': False, 'merge' : False})
        xml_file = open("test/test_mergelinks1.xml", 'rb')
        XMLHelpers.parseXML2(xml_file,{'check': False, 'merge' : True})
        temp = db.GqlQuery("SELECT * FROM Link")
        
        for i in temp:
            if i.link_type == "image":
                self.assert_(i.link_url == "")
                break

        db.delete(db.Query())
    def test_mergeLinks1(self):
        xml_file = open("test/test_mergelinks1.xml", 'rb')
        XMLHelpers.parseXML2(xml_file,{'check': False, 'merge' : False})
        xml_file = open("test/test_mergelinks4.xml", 'rb')
        XMLHelpers.parseXML2(xml_file,{'check': False, 'merge' : True})
        temp = db.GqlQuery("SELECT * FROM Link")
        
        #Stuff
        for i in temp:
            if i.link_type == "image":
                self.assert_(i.link_url == "http://images5.fanpop.com/image/photos/30600000/Mr-President-WTF-weegee-vs-tails-doll-30625832-435-360.jpg")
                break

        db.delete(db.Query())        
    def test_mergeModels1(self):
        xml_file = open("test/test_mergemodels1.xml", 'rb')
        XMLHelpers.parseXML2(xml_file,{'check': False, 'merge' : False})
        temp = db.GqlQuery("SELECT * FROM Crisis")

        before_merge = ''
        for c in temp:
            before_merge = c.info_resources
        
        xml_file = open("test/test_mergelinks1.xml", 'rb')
        XMLHelpers.parseXML2(xml_file,{'check': False, 'merge' : True})
        temp = db.GqlQuery("SELECT * FROM Crisis")

        after_merge = ''
        for c in temp:
            after_merge = c.info_resources

        self.assert_(before_merge == after_merge)

        db.delete(db.Query())