From: Jason Ish Date: Thu, 7 Oct 2021 18:34:25 +0000 (-0600) Subject: tests: fix checksum test for new argument type X-Git-Tag: 1.3.0rc1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=720ec5642f97ccf370e02ce659f915de090513e6;p=thirdparty%2Fsuricata-update.git tests: fix checksum test for new argument type --- diff --git a/suricata/update/main.py b/suricata/update/main.py index eed2805..7d3b366 100644 --- a/suricata/update/main.py +++ b/suricata/update/main.py @@ -105,6 +105,7 @@ class Fetch: self.istty = os.isatty(sys.stdout.fileno()) def check_checksum(self, tmp_filename, url): + print(url) try: checksum_url = url[0] + ".md5" net_arg=(checksum_url,url[1]) diff --git a/tests/test_main.py b/tests/test_main.py index 1425cd1..86fa486 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -62,7 +62,12 @@ class TestFetch(unittest.TestCase): os.path.dirname(os.path.realpath(__file__))) local_file = "%s/emerging.rules.tar.gz" % ( os.path.dirname(os.path.realpath(__file__))) - r = fetch.check_checksum(local_file, url) + + # The URL passed to check_checksum is actually a tuple: + # (url, custom-header, has checksum url) + net_arg = (url, None, True) + + r = fetch.check_checksum(local_file, net_arg) self.assertTrue(r) class ThresholdProcessorTestCase(unittest.TestCase):