Ejemplo n.º 1
0
 def test_search_does_prefetch(self):
     games = pyBGG.search("1830", prefetch=True)
     hits = [
         "http://www.boardgamegeek.com/xmlapi/search?search=1830",
         "http://www.boardgamegeek.com/xmlapi/boardgame/88400,37322,31013,111775,421,31230,56839,56841,56840,59644,59645,23189,70875,2396",
     ]
     self.assertListEqual(handler.hits, hits)
Ejemplo n.º 2
0
 def test_search_does_prefetch(self):
     games = pyBGG.search("1830", prefetch=True)
     hits = [
         "http://www.boardgamegeek.com/xmlapi/search?search=1830",
         "http://www.boardgamegeek.com/xmlapi/boardgame/88400,37322,31013,111775,421,31230,56839,56841,56840,59644,59645,23189,70875,2396",
         ]
     self.assertListEqual(handler.hits, hits)
Ejemplo n.º 3
0
 def test_game_names_from_search(self):
     bg = pyBGG.search("I Coloni di Catan", exact=1)
     self.assertIn("The Settlers of Catan", bg.names)
     self.assertIn("I Coloni di Catan", bg.names)
Ejemplo n.º 4
0
 def test_description_in_search(self):
     resp = pyBGG.search("1830: Railways & Robber Barons")
     self.assertIn("1830 is one of the most famous 18xx games",
                   resp[0].description)
Ejemplo n.º 5
0
 def test_name_in_search(self):
     resp = pyBGG.search("1830: Railways & Robber Barons")
     self.assertIn("1830", resp[0].name)
Ejemplo n.º 6
0
 def test_exact_search(self):
     bg = pyBGG.search("I Coloni di Catan", exact=1)
     self.assertEqual("13", bg.id)
Ejemplo n.º 7
0
 def test_exact_search_gone_wrong(self):
     bg = pyBGG.search("pyBGG test search", exact=1)
     self.assertEqual(None, bg)
Ejemplo n.º 8
0
 def test_game_names_from_search(self):
     bg = pyBGG.search("I Coloni di Catan", exact=1)
     self.assertIn("The Settlers of Catan", bg.names)
     self.assertIn("I Coloni di Catan", bg.names)
Ejemplo n.º 9
0
 def test_description_in_search(self):
     resp = pyBGG.search("1830: Railways & Robber Barons")
     self.assertIn("1830 is one of the most famous 18xx games", resp[0].description)
Ejemplo n.º 10
0
 def test_name_in_search(self):
     resp = pyBGG.search("1830: Railways & Robber Barons")
     self.assertIn("1830", resp[0].name)
Ejemplo n.º 11
0
 def test_exact_search(self):
     bg = pyBGG.search("I Coloni di Catan", exact=1)
     self.assertEqual("13", bg.id)
Ejemplo n.º 12
0
 def test_exact_search_gone_wrong(self):
     bg = pyBGG.search("pyBGG test search", exact=1)
     self.assertEqual(None, bg)