def test_filial_code_place(self): with open(os.path.join(os.getcwd(), 'test/html/index_search.html'), 'r') as f: html = f.read() code, place = parse_filial_searchresult(html) self.assertEqual(u"Дніпропетровськ", place) self.assertEqual(32000100227819, code)
def test_filial_code_place_31000(self): with open(os.path.join(os.getcwd(), 'test/html/index_search_31000.html'), 'r') as f: html = f.read() code, place = parse_filial_searchresult(html) self.assertEqual(32000100524043, code) self.assertEqual(u"Слобідка Красилівська", place)
def test_empty_filial(self): with open(os.path.join(os.getcwd(), 'test/html/filial_empty.html'), 'r') as f: html = f.read() code, place = parse_filial_searchresult(html) self.assertEqual(False, place) self.assertEqual(False, code)