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)
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)
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)
def test_name_in_search(self): resp = pyBGG.search("1830: Railways & Robber Barons") self.assertIn("1830", resp[0].name)
def test_exact_search(self): bg = pyBGG.search("I Coloni di Catan", exact=1) self.assertEqual("13", bg.id)
def test_exact_search_gone_wrong(self): bg = pyBGG.search("pyBGG test search", exact=1) self.assertEqual(None, bg)