]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
tests: fix checksum test for new argument type
authorJason Ish <jason.ish@oisf.net>
Thu, 7 Oct 2021 18:34:25 +0000 (12:34 -0600)
committerJason Ish <jason.ish@oisf.net>
Thu, 7 Oct 2021 18:34:39 +0000 (12:34 -0600)
suricata/update/main.py
tests/test_main.py

index eed2805b3b7df66d37681b263ba56e9840aefe94..7d3b36648a589adbdffc69543184cdb275d631ed 100644 (file)
@@ -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])
index 1425cd199feb9e4a30bbce42db4d46ab9658350b..86fa486ad3de336182b12b364ba855ace821e703 100644 (file)
@@ -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):