3. Tests

Tests for Swiftea-Crawler using pytest.

3.1. tests.run_tests

3.2. tests.swiftea_bot_test

class tests.swiftea_bot_test.SwifteaBotBaseTest[source]

Bases: object

setup_method(_)[source]
class tests.swiftea_bot_test.TestFileManager[source]

Bases: tests.swiftea_bot_test.SwifteaBotBaseTest

test_check_stop_crawling()[source]
test_get_inverted_index()[source]
test_get_lists_words()[source]
test_get_url()[source]
test_init()[source]
test_read_inverted_index()[source]
test_save_config()[source]
test_save_inverted_index()[source]
class tests.swiftea_bot_test.TestModule[source]

Bases: tests.swiftea_bot_test.SwifteaBotBaseTest

test_can_add_doc()[source]
test_create_dirs()[source]
test_is_index()[source]
test_remove_duplicates()[source]
test_stats_webpages()[source]
test_tell()[source]

3.3. tests.crawling_test

class tests.crawling_test.CrawlingBaseTest[source]

Bases: object

Base class for all crawler test classes.

setup_method(_)[source]

Configure the app.

class tests.crawling_test.TestConnection[source]

Bases: tests.crawling_test.CrawlingBaseTest

test_all_urls()[source]
test_check_connection()[source]
test_duplicate_content()[source]
test_is_nofollow()[source]
class tests.crawling_test.TestParsers[source]

Bases: tests.crawling_test.CrawlingBaseTest

test_can_append()[source]
test_handle_charref()[source]
test_handle_entityref()[source]
test_meta()[source]
test_parser()[source]
test_parser_encoding()[source]
class tests.crawling_test.TestSearches[source]

Bases: tests.crawling_test.CrawlingBaseTest

test_capitalize()[source]
test_clean_text()[source]
test_get_base_url()[source]
test_is_homepage()[source]
class tests.crawling_test.TestSiteInformations[source]

Bases: tests.crawling_test.CrawlingBaseTest

test_clean_favicon()[source]
test_clean_keywords()[source]
test_detect_language()[source]
test_set_listswords()[source]
class tests.crawling_test.TestWebConnection[source]

Bases: tests.crawling_test.CrawlingBaseTest

test_check_robots_perm()[source]
test_duplicate_content()[source]
test_search_encoding()[source]
test_send_request()[source]

3.4. tests.database_test

class tests.database_test.DatabaseBaseTest[source]

Bases: object

Base class for all crawler test classes.

setup_method(_)[source]
class tests.database_test.TestDatabase[source]

Bases: tests.database_test.DatabaseBaseTest

test_convert_secure()[source]
test_url_is_secure()[source]

3.5. tests.index_test

class tests.index_test.IndexBaseTest[source]

Bases: object

setup_method(_)[source]
class tests.index_test.TestIndex[source]

Bases: tests.index_test.IndexBaseTest

test_count_files_index()[source]
test_stats_dl_index()[source]
test_stats_ul_index()[source]
class tests.index_test.TestInvertedIndex[source]

Bases: tests.index_test.IndexBaseTest

test_add_word()[source]
test_create_inverted_index()[source]
test_delete_doc_id()[source]
test_delete_id_word()[source]
test_delete_word()[source]
test_getInvertedIndex()[source]
test_setInvertedIndex()[source]

3.6. tests.crawler_test

3.7. tests.global_test

3.8. tests.test_data

tests.test_data.reset()[source]