예제 #1
0
    def test_search_results_correct_info(self):
        results = db.execute_search("charles", "charles", self.database)

        self.assertTrue(len(results) == 2)

        self.assertTrue(
            results[0]
            == (
                "or",
                ["<b>Charles</b> Buchanan Hickcox", "8695"],
                ["Aquatics", "1"],
                ["100m backstroke", "84"],
                ["1968", "1"],
                ["Mexico", "1"],
                ["United States", "195"],
                ["Mexico", "122"],
            )
        )
        self.assertTrue(
            results[1]
            == (
                "and",
                ["<b>Charles</b> Buchanan Hickcox", "8695"],
                ["Aquatics", "1"],
                ["100m backstroke", "84"],
                ["1968", "1"],
                ["Mexico", "1"],
                ["United States", "195"],
                ["Mexico", "122"],
            )
        )
예제 #2
0
    def test_search_results_not_null(self):
        results = db.execute_search("aquatics", "aquatics", self.database)

        for row in results:
            for col in row:
                for i in col:
                    self.assertTrue(i is not None)
예제 #3
0
 def test_search_results_correct_info(self):
     results = db.execute_search('charles', 'charles', self.database)
     
     self.assertTrue(len(results)==2)
     
     self.assertTrue(results[0] == ('or', ["<b>Charles</b> Buchanan Hickcox",'8695'], ['Aquatics','1'], ["100m backstroke",'84'], ['1968','1'], ['Mexico','1'], ["United States",'195'], ['Mexico','122']))
     self.assertTrue(results[1] == ('and', ["<b>Charles</b> Buchanan Hickcox",'8695'], ['Aquatics','1'], ["100m backstroke",'84'], ['1968','1'], ['Mexico','1'], ["United States",'195'], ['Mexico','122']))
예제 #4
0
 def test_search_results_not_null(self):
     results = db.execute_search('aquatics', 'aquatics', self.database)
     
     for row in results:
         for col in row:
             for i in col:
                 self.assertTrue(i is not None)
예제 #5
0
    def test_search_results_none(self):
        results = db.execute_search("mortimer", "mortimer", self.database)

        self.assertTrue(len(results) == 0)
예제 #6
0
 def test_search_results_none(self):
     results = db.execute_search('mortimer', 'mortimer', self.database)
     
     self.assertTrue(len(results)==0)