Esempio n. 1
0
def test_multiple_results_blacklisted_allowed(create_reports_dirs,
                                              remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '88-140 GNIEWKOWO' + '\n\n' + \
        '#Przedsiębiorstwo' + '\n\n' + \
        'Gniewkowo Sp. z o.o. Przedsiębiorstwo komunalne' + '\n' + \
        'Jana Kilińskiego 9' + '\n' + \
        '88-140 Gniewkowo' + '\n\n' + \
        'I.T.I. Poland Sp. z o.o.' + '\n' + \
        'Przemysłowa 2' + '\n' + \
        '88-140 Gniewkowo' + '\n\n' + \
        'Przedsiębiorstwo Techniki Pompowej IMPELLER' + '\n' + \
        'Zajezierze 8 B' + '\n' + \
        '88-140 Gniewkowo' + '\n\n' + \
        'Pipczyńska Katarzyna. Przedsiębiorstwo wielobranżowe' + '\n' + \
        'Jana Kilińskiego 49' + '\n' + \
        '88-140 Gniewkowo' + '\n\n' + \
        'Tinapol. PH. Lubańska T.' + '\n' + \
        'Wojska Polskiego 23' + '\n' + \
        '88-140 Gniewkowo' + '\n\n' + \
        'Przedsiębiorstwo Wielobranżowe "e-mir"' + '\n' + \
        'Toruńska 33a' + '\n' + \
        '88-140 Gniewkowo' + '\n\n' + \
        'Results found: 6'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='multiple_results_blacklisted_allowed')
    searcher = run_google_searcher(data_dir_path,
                                   report_dir_path,
                                   allow_blacklisted=True)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 2
0
def test_multiple_results(create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '33-300 NOWY SĄCZ' + '\n\n' + \
        '#muzeum' + '\n\n' + \
        'Muzeum Okręgowe w Nowym Sączu' + '\n' + \
        'Lwowska 3' + '\n' + \
        '33-300 Nowy Sącz' + '\n\n' + \
        'Muzeum Okręgowe w Nowym Sączu - Gmach Głowny' + '\n' + \
        'Jagiellońska 56' + '\n' + \
        '33-300 Nowy Sącz' + '\n\n' + \
        'Sądecki Park Etnograficzny' + '\n' + \
        'Gen. Wieniawy-Długoszowskiego 83B' + '\n' + \
        '33-300 Nowy Sącz' + '\n\n' + \
        'Miasteczko Galicyjskie. Oddział Muzeum Okręgowego w Nowym Sączu' + '\n' + \
        'Lwowska 226' + '\n' + \
        '33-300 Nowy Sącz' + '\n\n' + \
        'Galeria Marii Ritter. Oddział Muzeum Okręgowego' + '\n' + \
        'Rynek 2' + '\n' + \
        '33-300 Nowy Sącz' + '\n\n' + \
        'Results found: 5'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='multiple_results')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 3
0
def test_multiple_results_twice(create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '38-315 KUNKOWA' + '\n\n' + \
        'Koło Gospodyń Wiejskich i Gospodarzy w Kunkowej' + '\n' + \
        'Kunkowa 18' + '\n' + \
        '38-315 Kunkowa' + '\n\n' + \
        'Koło Gospodyń Wiejskich w Kunkowej i Leszczynach' + '\n' + \
        'Kunkowa 18' + '\n' + \
        '38-315 Kunkowa' + '\n\n' + \
        '======================================================================' + '\n' + \
        '33-393 MARCINKOWICE' + '\n\n' + \
        'KOŁO GOSPODYŃ WIEJSKICH W MARCINKOWICACH' + '\n' + \
        'Marcinkowice 124' + '\n' + \
        '33-393 Marcinkowice' + '\n\n' + \
        'KOŁO GOSPODYŃ WIEJSKICH W MARCINKOWICACH' + '\n' + \
        'Marcinkowice 104' + '\n' + \
        '33-393 Marcinkowice' + '\n\n' + \
        'Koło Gospodyń Wiejskich "Marcinkowicanki"' + '\n' + \
        'Marcinkowice 47' + '\n' + \
        '33-273 Marcinkowice' + '\n\n' + \
        'Results found: 5'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='multiple_results_twice')
    searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 4
0
def test_multiple_results_duplicate_allowed(create_reports_dirs,
                                            remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '38-315 KUNKOWA' + '\n\n' + \
        'Koło Gospodyń Wiejskich i Gospodarzy w Kunkowej' + '\n' + \
        'Kunkowa 18' + '\n' + \
        '38-315 Kunkowa' + '\n\n' + \
        'Koło Gospodyń Wiejskich w Kunkowej i Leszczynach' + '\n' + \
        'Kunkowa 18' + '\n' + \
        '38-315 Kunkowa' + '\n\n' + \
        '======================================================================' + '\n' + \
        '38-315 KUNKOWA' + '\n\n' + \
        'Koło Gospodyń Wiejskich i Gospodarzy w Kunkowej' + '\n' + \
        'Kunkowa 18' + '\n' + \
        '38-315 Kunkowa' + '\n\n' + \
        'Koło Gospodyń Wiejskich w Kunkowej i Leszczynach' + '\n' + \
        'Kunkowa 18' + '\n' + \
        '38-315 Kunkowa' + '\n\n' + \
        'Results found: 4'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='multiple_results_duplicate_allowed')
    searcher = run_krkgw_searcher(data_dir_path,
                                  report_dir_path,
                                  allow_duplicates=True)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 5
0
def test_multiple_results_indirect_matches_by_zip_code_head_allowed(
        create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '33-393 MARCINKOWICE' + '\n\n' + \
        '#Szkoła' + '\n\n' + \
        'Szkoła Podstawowa im. Marszałka Józefa Piłsudskiego' + '\n' + \
        '33-393' + '\n' + \
        'Marcinkowicka 132' + '\n' + \
        '33-395 Marcinkowice' + '\n\n' + \
        'Zespół Szkół im. Władysława Orkana' + '\n' + \
        'Marcinkowice 1' + '\n' + \
        '33-395 Marcinkowice' + '\n\n' + \
        'Szkoła Podstawowa im. Stanisława i Jana Potoczków' + '\n' + \
        '33-395 Rdziostów' + '\n\n' + \
        'Szkoła Podstawowa im. Mieszka l' + '\n' + \
        'Marcinkowicka 46' + '\n' + \
        '78-640 Marcinkowice' + '\n\n' + \
        'Szkoła Pływania "TB" Tomasz Baliczek' + '\n' + \
        'Marcinkowicka 9' + '\n' + \
        '33-395 Nowy Sącz' + '\n\n' + \
        'Results found: 5'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite,
        test_case='multiple_results_indirect_matches_by_zip_code_head_allowed')
    searcher = run_google_searcher(data_dir_path,
                                   report_dir_path,
                                   allow_indirect_matches=True)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 6
0
def test_no_result(create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '24-200 BABIN' + '\n\n' + \
        'Results found: 0'

    data_dir_path, report_dir_path = get_io_dir_paths(test_suite,
                                                      test_case='no_result')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 7
0
def test_single_result_indirect_match_skipped(create_reports_dirs,
                                              remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '33-334 BOGUSZA' + '\n\n' + \
        'Results found: 0'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result_indirect_match_skipped')
    searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 8
0
def test_single_result_indirect_match_by_city_skipped(create_reports_dirs,
                                                      remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '24-300 WOLA RUDZKA' + '\n\n' + \
        'Results found: 0'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result_indirect_match_by_city_skipped')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 9
0
def test_multiple_results_indirect_matches_by_city_allowed(
        create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '87-207 MAŁE PUŁKOWO' + '\n\n' + \
        '#PZU' + '\n\n' + \
        'PZU' + '\n' + \
        'Wolności 44' + '\n' + \
        '87-200 Wąbrzeźno' + '\n\n' + \
        'PZU' + '\n' + \
        'Plac Tysiąclecia 22A' + '\n' + \
        '87-400 Golub-Dobrzyń' + '\n\n' + \
        'PZU Ubezpieczenia Wąbrzeźno - Agent Andrzej Sadłowski' + '\n' + \
        'Poniatowskiego 8' + '\n' + \
        '87-200 Wąbrzeźno' + '\n\n' + \
        'Kuźnia Smaków' + '\n' + \
        '20' + '\n' + \
        '20' + '\n' + \
        '87-207 Małe Pułkowo' + '\n\n' + \
        'PZU Ubezpieczenia Czernikowo - Agent Bożena Zygnerska-Nawrotek' + '\n' + \
        'Juliusza Słowackiego 3' + '\n' + \
        '87-125 Czernikowo' + '\n\n' + \
        'Agencja PZU S.A' + '\n' + \
        'Generała Władysława Sikorskiego 36a' + '\n' + \
        '87-140 Chełmża' + '\n\n' + \
        'Grochocka G. Ubezpieczenia' + '\n' + \
        'Krasińskiego 5' + '\n' + \
        '87-200 Wąbrzeźno' + '\n\n' + \
        'PZU Ubezpieczenia Brodnica - Agent Katarzyna Korzeńska' + '\n' + \
        'Główna 29' + '\n' + \
        '87-300 Jabłonowo Pomorskie' + '\n\n' + \
        'PZU Ubezpieczenia Rypin - Agent Grzegorz Makowski' + '\n' + \
        'Jana Pawła II 6' + '\n' + \
        '87-500 Rypin' + '\n\n' + \
        'Oddział PZU - Rypin, Nowy Rynek,' + '\n' + \
        'Nowy Rynek 6' + '\n' + \
        '87-500 Rypin' + '\n\n' + \
        'Markostal Marek Mrowiński' + '\n' + \
        'Małe Pułkowo 67' + '\n' + \
        '87-207 Małe Pułkowo' + '\n\n' + \
        'Bieganowska Anna. Ubezpieczenia' + '\n' + \
        'Plac Tysiąclecia 2' + '\n' + \
        '87-400 Golub-Dobrzyń' + '\n\n' + \
        'Results found: 12'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite,
        test_case='multiple_results_indirect_matches_by_city_allowed')
    searcher = run_google_searcher(data_dir_path,
                                   report_dir_path,
                                   allow_indirect_matches=True)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 10
0
def test_single_result_blacklisted_skipped(create_reports_dirs,
                                           remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '13-340 BIELICE' + '\n\n' + \
        'Results found: 0'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result_blacklisted_skipped')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 11
0
def test_no_result_twice(create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '33-383 MUSZYNKA' + '\n\n' + \
        '======================================================================' + '\n' + \
        '33-322 JASIENNA' + '\n\n' + \
        'Results found: 0'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='no_result_twice')
    searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 12
0
def test_distances_from_one_main_city(data_dir_path, reports_dir_path, create_reports_dir, remove_reports_dir):
    expected_report = \
        '======================================================================' + '\n' + \
        'Kraków' + '\n\n' + \
        '32-566 Alwernia: 39,3 km' + '\n' + \
        '34-120 Andrychów: 62,5 km' + '\n' + \
        '32-551 Babice: 46,9 km' + '\n' + \
        '34-116 Bachowice: 48,8 km' + '\n' + \
        '99-999 Dupowory: None' + '\n' + \
        '32-661 Bobrek: 61,2 km' + '\n'

    searcher = MapSearcher(main_city='Kraków', data_dir_path=data_dir_path, report_dir_path=reports_dir_path)
    searcher.search()
    assert_report_file_content_equals(expected_report, searcher.report_file_path)
Esempio n. 13
0
def test_single_result(create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '21-075 ZEZULIN PIERWSZY' + '\n\n' + \
        'Koło Gospodyń Wiejskich "Zezulin" w Zezulinie' + '\n' + \
        'Zezulin Pierwszy 22A' + '\n' + \
        '21-075 Zezulin Pierwszy' + '\n\n' + \
        'Results found: 1'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result')
    searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 14
0
def test_single_result_with_two_lines(create_reports_dirs,
                                      remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '34-603 UJANOWICE' + '\n\n' + \
        '#Klub' + '\n\n' + \
        'AKS UJANOWICE' + '\n' + \
        '34-603 Ujanowice' + '\n\n' + \
        'Results found: 1'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result_with_two_lines')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 15
0
def test_multiple_results_with_empty_details(create_reports_dirs,
                                             remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '89-200 TUR' + '\n\n' + \
        'Koło Gospodyń Wiejskich Centrum Kultury Ostrowite' + '\n' + \
        'ul. Szkolna 22' + '\n' + \
        '89-620 Ostrowite' + '\n\n' + \
        'Results found: 1'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='multiple_results_with_empty_details')
    searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 16
0
def test_single_result(create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '21-030 KONOPNICA' + '\n\n' + \
        '#Urząd' + '\n\n' + \
        'Urząd Gminy Konopnica' + '\n' + \
        'Kozubszczyzna 127a' + '\n' + \
        '21-030 Motycz' + '\n\n' + \
        'Results found: 1'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 17
0
def test_single_result_indirect_match_by_zip_code_tail_allowed(
        create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '24-150 NAŁĘCZÓW' + '\n\n' + \
        '#Wydział' + '\n\n' + \
        'Urząd Miejski w Nałęczowie' + '\n' + \
        'Lipowa 3' + '\n' + \
        '24-140 Nałęczów' + '\n\n' + \
        'Results found: 1'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite,
        test_case='single_result_indirect_match_by_zip_code_tail_allowed')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 18
0
def test_single_result_with_four_lines(create_reports_dirs,
                                       remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '32-862 PORĄBKA IWKOWSKA' + '\n\n' + \
        '#Produkcja' + '\n\n' + \
        'P.P.H.U. NITUS Piotr Nowak' + '\n' + \
        'Drużków Pusty' + '\n' + \
        'Porąbka Iwkowska 9' + '\n' + \
        '32-862 Porąbka Iwkowska' + '\n\n' + \
        'Results found: 1'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result_with_four_lines')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 19
0
def test_single_result_indirect_match_allowed(create_reports_dirs,
                                              remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '33-334 BOGUSZA' + '\n\n' + \
        'Koło Gospodyń Wiejskich w Boguszach' + '\n' + \
        'Bogusze 45' + '\n' + \
        '16-100 Bogusze' + '\n\n' + \
        'Results found: 1'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result_indirect_match_allowed')
    searcher = run_krkgw_searcher(data_dir_path,
                                  report_dir_path,
                                  allow_indirect_matches=True)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 20
0
def test_single_result_twice(create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '34-600 MORDARKA' + '\n\n' + \
        '#Przedszkole' + '\n\n' + \
        'Niepubliczne Przedszkole Integracyjne Chatka Małego Skrzatka' + '\n' + \
        '34-600 Mordarka' + '\n\n' + \
        '#Produkcja' + '\n\n' + \
        'FUHP Stalkomplet S.C Walenty Szubryt Stanisław Bubula' + '\n' + \
        'Mordarka dz.1236' + '\n' + \
        '34-600' + '\n\n' + \
        'Results found: 2'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result_twice')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 21
0
def test_single_result_blacklisted_allowed(create_reports_dirs,
                                           remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '13-340 BIELICE' + '\n\n' + \
        '#Szkoła' + '\n\n' + \
        'Zespół Szkół w Bielicach, Gimnazjum im. Narodów Zjednoczonej Europy' + '\n' + \
        'Bielice 120' + '\n' + \
        '13-330 Bielice' + '\n\n' + \
        'Results found: 1'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result_blacklisted_allowed')
    searcher = run_google_searcher(data_dir_path,
                                   report_dir_path,
                                   allow_blacklisted=True)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 22
0
def test_single_result_indirect_match_by_city_allowed(create_reports_dirs,
                                                      remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '34-654 PISARZOWA' + '\n\n' + \
        '#Sąd' + '\n\n' + \
        'Sąd Rejonowy w Limanowej' + '\n' + \
        'Marka 19' + '\n' + \
        '34-600 Limanowa' + '\n\n' + \
        'Results found: 1'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result_indirect_match_by_city_allowed')
    searcher = run_google_searcher(data_dir_path,
                                   report_dir_path,
                                   allow_indirect_matches=True)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 23
0
def test_single_result_indirect_match_by_zip_code_head_allowed(
        create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '32-725 RAJBRO' + '\n\n' + \
        '#ZNP' + '\n\n' + \
        'Związek Nauczycielstwa Polskiego. Oddział' + '\n' + \
        'Jana Pawła II 42' + '\n' + \
        '34-600 Limanowa' + '\n\n' + \
        'Results found: 1'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite,
        test_case='single_result_indirect_match_by_zip_code_head_allowed')
    searcher = run_google_searcher(data_dir_path,
                                   report_dir_path,
                                   allow_indirect_matches=True)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 24
0
def test_single_result_duplicate_skipped(create_reports_dirs,
                                         remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '34-603 STRZESZYCE' + '\n\n' + \
        '#Produkcja' + '\n\n' + \
        'Olivea Małopolska Sp. z o. o.' + '\n' + \
        'Strzeszyce 115' + '\n' + \
        '34-603 Ujanowice' + '\n' + \
        '34-603' + '\n\n' + \
        '======================================================================' + '\n' + \
        '34-603 STRZESZYCE' + '\n\n' + \
        'Results found: 1'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result_duplicate_skipped')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 25
0
def test_single_result_twice(create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '22-234 SĘKÓW' + '\n\n' + \
        'KOŁO GOSPODYŃ WIEJSKICH "BUBNOWSKIE BABY"' + '\n' + \
        'Sęków 15' + '\n' + \
        '22-234 Sęków' + '\n\n' + \
        '======================================================================' + '\n' + \
        '21-421 ZASTAWIE' + '\n\n' + \
        'Koło Gospodyń Wiejskich w Zastawiu' + '\n' + \
        'Zastawie 47A' + '\n' + \
        '21-421 Zastawie' + '\n\n' + \
        'Results found: 2'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='single_result_twice')
    searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 26
0
def test_multiple_results_indirect_matches_allowed(create_reports_dirs,
                                                   remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '24-100 TOMASZÓW' + '\n\n' + \
        'Koło Gospodyń Wiejskich w Tomaszowie' + '\n' + \
        'Tomaszów lok. 39' + '\n' + \
        '24-100 Tomaszów' + '\n\n' + \
        'Koło Gospodyń Wiejskich w Tomaszowie' + '\n' + \
        'Tomaszów 44 "b"' + '\n' + \
        '26-505 Tomaszów' + '\n\n' + \
        'Results found: 2'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='multiple_results_indirect_matches_allowed')
    searcher = run_krkgw_searcher(data_dir_path,
                                  report_dir_path,
                                  allow_indirect_matches=True)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 27
0
def test_multiple_results_indirect_matches_skipped(create_reports_dirs,
                                                   remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '33-393 MARCINKOWICE' + '\n\n' + \
        'KOŁO GOSPODYŃ WIEJSKICH W MARCINKOWICACH' + '\n' + \
        'Marcinkowice 124' + '\n' + \
        '33-393 Marcinkowice' + '\n\n' + \
        'KOŁO GOSPODYŃ WIEJSKICH W MARCINKOWICACH' + '\n' + \
        'Marcinkowice 104' + '\n' + \
        '33-393 Marcinkowice' + '\n\n' + \
        'Koło Gospodyń Wiejskich "Marcinkowicanki"' + '\n' + \
        'Marcinkowice 47' + '\n' + \
        '33-273 Marcinkowice' + '\n\n' + \
        'Results found: 3'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='multiple_results_indirect_matches_skipped')
    searcher = run_krkgw_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 28
0
def test_multiple_results_indirect_matches_by_city_skipped(
        create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '87-207 MAŁE PUŁKOWO' + '\n\n' + \
        '#PZU' + '\n\n' + \
        'Kuźnia Smaków' + '\n' + \
        '20' + '\n' + \
        '20' + '\n' + \
        '87-207 Małe Pułkowo' + '\n\n' + \
        'Markostal Marek Mrowiński' + '\n' + \
        'Małe Pułkowo 67' + '\n' + \
        '87-207 Małe Pułkowo' + '\n\n' + \
        'Results found: 2'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite,
        test_case='multiple_results_indirect_matches_by_city_skipped')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 29
0
def test_multiple_results_indirect_matches_by_zip_code_head_skipped(
        create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '33-393 MARCINKOWICE' + '\n\n' + \
        '#Szkoła' + '\n\n' + \
        'Szkoła Podstawowa im. Marszałka Józefa Piłsudskiego' + '\n' + \
        '33-393' + '\n' + \
        'Marcinkowicka 132' + '\n' + \
        '33-395 Marcinkowice' + '\n\n' + \
        'Zespół Szkół im. Władysława Orkana' + '\n' + \
        'Marcinkowice 1' + '\n' + \
        '33-395 Marcinkowice' + '\n\n' + \
        'Results found: 2'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite,
        test_case='multiple_results_indirect_matches_by_zip_code_head_skipped')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)
Esempio n. 30
0
def test_multiple_results_twice(create_reports_dirs, remove_reports_dirs):
    expected_report = \
        '======================================================================' + '\n' + \
        '86-134 DOLNA GRUPA' + '\n\n' + \
        '#Produkcja' + '\n\n' + \
        'O.M.N. Altomix' + '\n' + \
        'Dolna Grupa 55B' + '\n' + \
        '86-134 Dolna Grupa' + '\n\n' + \
        'BUMAX Okna Drzwi Meble' + '\n' + \
        'Tartaczna 9' + '\n' + \
        '86-134 Dolna Grupa' + '\n\n' + \
        'Altomix sp.j. Odlewnia metali' + '\n' + \
        'Dolna Grupa 55b' + '\n' + \
        '86-134 Dolna Grupa' + '\n\n' + \
        'Klocek Ryszard. Deski, więźby dachowe. Usługi tartaczne' + '\n' + \
        '86-134 Dolna Grupa; Tartaczna' + '\n' + \
        '86-134' + '\n\n' + \
        'Kubiak-Pol. Skup, sprzedaż naprawa palet' + '\n' + \
        'DK91 18' + '\n' + \
        '86-134 Dolna Grupa' + '\n\n' + \
        '======================================================================' + '\n' + \
        '87-123 GŁOGOWO' + '\n\n' + \
        '#Produkcja' + '\n\n' + \
        'ALWA' + '\n' + \
        'Spokojna 8' + '\n' + \
        '87-123 Głogowo' + '\n\n' + \
        'WW Ekochem' + '\n' + \
        'Akacjowa 1' + '\n' + \
        '87-123 Głogowo' + '\n\n' + \
        'MECHATRONIKA' + '\n' + \
        'Ul: Wilcza 36' + '\n' + \
        'Głogowo' + '\n' + \
        '87-123 Dobrzejewice' + '\n\n' + \
        'Results found: 8'

    data_dir_path, report_dir_path = get_io_dir_paths(
        test_suite, test_case='multiple_results_twice')
    searcher = run_google_searcher(data_dir_path, report_dir_path)
    assert_report_file_content_equals(expected_report,
                                      searcher.report_file_path)