test_module module

Test all functions used to execute pypi-scan

class test_module.TestFunctions(methodName='runTest')

Bases: unittest.case.TestCase

Test all functions for pypi-scan script.

test_commandline()

Test command line usage.

test_compare_metadata()

Test compare_metadata functionality

test_create_suspicious_package_dict()

Test create_suspicious_package_dict function

test_distance_calculations()

Test distance_calculations function.

test_end2end()

Test pypi-scan analysis from start to finish.

test_filter_by_package_name_len()

Test filterByPackageNameLen.

test_get_all_packages()

Test get_all_packages function.

test_get_metadata()

Test metadata scrape functionality on pcap2map.

This package uses pcap2map because John Speed developed pcap2map and placed it on PyPI and he has no intention of changing the metadata associated with the PyPI package.

test_get_top_packages()

Test get_top_packages function.

test_homophone_attack_screen()
test_load_most_recent_packages()

Test load_most_recent_packages function.

test_order_attack_screen()

Test order_attack_screen function

test_potential_squatter_names()

Test create_potential_squatter_names function.

test_print_suspicious_packages()

Test print_suspicious_packages function.

This function has awkward syntax given the need to output colored text.

test_recent_scan_command_line()

Test scan recent functionality end to end.

This test can be slow if the most recent scan for comparison was more than a few days ago.

test_store_recent_scan_results()

Test store_recent_scan_results function.

test_whitelist()

Test whitelist function.