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 2021/06/02 14:26:20 UTC

[incubator-ponymail-unit-tests] branch master updated: The alternate values only apply to v0.10

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 b2c9fa5  The alternate values only apply to v0.10
b2c9fa5 is described below

commit b2c9fa589e3402f3bb5b730fde04303fb5d4fd0e
Author: Sebb <se...@apache.org>
AuthorDate: Wed Jun 2 15:26:07 2021 +0100

    The alternate values only apply to v0.10
    
    This is because 0.10 failed to detect format=flowed emails
    Subsequent versions don't need this override
---
 tests/test-generators.py | 4 +++-
 tests/test-parsing.py    | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/test-generators.py b/tests/test-generators.py
index 42d4ee7..d730b3d 100755
--- a/tests/test-generators.py
+++ b/tests/test-generators.py
@@ -147,7 +147,9 @@ def run_tests(args):
                     json = archie.compute_updates(fake_args, lid, False, message, message_raw)
 
                     expected = test['generated']
-                    alternate = test.get('alternate') # alternate value for v0.10
+                    alternate = expected
+                    if archie.version == '10':
+                        alternate = test.get('alternate') # alternate value for v0.10
                     actual = json['mid']
                     if actual != expected and actual != alternate:
                         errors += 1
diff --git a/tests/test-parsing.py b/tests/test-parsing.py
index 88e9a68..fa55c86 100755
--- a/tests/test-parsing.py
+++ b/tests/test-parsing.py
@@ -113,7 +113,9 @@ def run_tests(args):
                     if not json.get('html_source_only'):
                         body_sha3_256 = hashlib.sha3_256(json['body'].encode('utf-8')).hexdigest()
                 expected = test['body_sha3_256']
-                alternate = test.get('alternate')
+                alternate = expected
+                if archie.version == '10':
+                    alternate = test.get('alternate') # alternate value for v0.10
                 if body_sha3_256 != expected and body_sha3_256 != alternate:
                     errors += 1
                     sys.stderr.write("""[FAIL] parsing index %2u: Expected: %s Got: %s\n""" %