You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2020/08/18 14:15:30 UTC

[incubator-ponymail-unit-tests] branch master updated: Check we are processing the correct message

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-unit-tests.git


The following commit(s) were added to refs/heads/master by this push:
     new 64d82bf  Check we are processing the correct message
64d82bf is described below

commit 64d82bf4ec9cd71a318bf0baeb839c6558ab5bb4
Author: Sebb <se...@apache.org>
AuthorDate: Tue Aug 18 15:15:19 2020 +0100

    Check we are processing the correct message
---
 tests/test-generators.py | 5 +++++
 tests/test-parsing.py    | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/tests/test-generators.py b/tests/test-generators.py
index 4e84dac..04a7d78 100755
--- a/tests/test-generators.py
+++ b/tests/test-generators.py
@@ -96,6 +96,11 @@ def run_tests(args):
                 tests_run += 1
                 message_raw = mbox.get_bytes(test['index'])  # True raw format, as opposed to calling .as_bytes()
                 message = mbox.get(test['index'])
+                msgid =(message.get('message-id') or '').strip()
+                if msgid != test['message-id']:
+                    sys.stderr.write("""[SEQ?] %s, index %2u: Expected '%s', got '%s'!\n""" %
+                                     (gen_type, test['index'], test['message-id'], msgid))
+                    continue # no point continuing
                 lid = args.lid or archiver.normalize_lid(message.get('list-id', '??'))
                 # Foal parameters
                 if 'raw_msg' in expected_compute_parameters:
diff --git a/tests/test-parsing.py b/tests/test-parsing.py
index dda60c2..3266888 100755
--- a/tests/test-parsing.py
+++ b/tests/test-parsing.py
@@ -84,6 +84,11 @@ def run_tests(args):
             tests_run += 1
             message_raw = mbox.get_bytes(test['index'])  # True raw format, as opposed to calling .as_bytes()
             message = mbox.get(test['index'])
+            msgid =(message.get('message-id') or '').strip()
+            if msgid != test['message-id']:
+                sys.stderr.write("""[SEQ?] index %2u: Expected '%s', got '%s'!\n""" %
+                                 (test['index'], test['message-id'], msgid))
+                continue # no point continuing
             lid = archiver.normalize_lid(message.get('list-id', '??'))
             # Foal parameters
             if 'raw_msg' in expected_compute_parameters: