diff --git a/blockfinder b/blockfinder index e64c977..e498e8c 100755 --- a/blockfinder +++ b/blockfinder @@ -507,7 +507,7 @@ class DownloaderParser: entry = False num_type = "" for line in lir_file: - line = line.decode('utf-8', errors='ignore').replace("\n", "") + line = line.decode('utf-8', 'ignore').replace("\n", "") if line == "": entry = False start_num, end_num, country_code, num_type = 0, 0, "", "" diff --git a/blockfindertest.py b/blockfindertest.py index edd365d..03c7fe3 100644 --- a/blockfindertest.py +++ b/blockfindertest.py @@ -2,6 +2,7 @@ import unittest import os import shutil +import sys import tempfile import blockfinder @@ -84,8 +85,11 @@ def test_ipv6_bf(self): if __name__ == '__main__': + failures = 0 for test_class in [CheckReverseLookup, CheckBlockFinder]: test_suite = unittest.makeSuite(test_class) test_runner = unittest.TextTestRunner(verbosity=2) - test_runner.run(test_suite) - + results = test_runner.run(test_suite) + failures += len(results.errors) + failures += len(results.failures) + sys.exit(failures)