[PATCH 01/20] test: new test framework to compare json parts

David Bremner david at tethera.net
Tue Jun 5 18:06:07 PDT 2018


Daniel Kahn Gillmor <dkg at fifthhorseman.net> writes:
> +
> +if len(sys.argv) < 2:
> +    sys.exit("""usage: {} EXPR [EXPR]
> +

the useage message doesn't seem to work? I get

╭─ zancas:software/upstream/notmuch/test 
╰─ (git)-[master]-% python3 json_check_nodes.py          
Traceback (most recent call last):
  File "json_check_nodes.py", line 42, in <module>
    """.format(sys.argv[0]))
KeyError: '"c"'

I guess this is not tested with python2?

╭─ zancas:software/upstream/notmuch/test 
╰─ (git)-[master]-%  echo '["a", "b", {"c": 1}]' | python2 json_check_nodes.py 'second_d:[1]="d"' 'no_c:[2]!"c"' 
Traceback (most recent call last):
  File "json_check_nodes.py", line 60, in <module>
    e = 'data{}'.format(expr['address'])
TypeError: '_sre.SRE_Match' object has no attribute '__getitem__'

The test suite currently supports python2 and python3 (or at least it's
supposed to).

d


More information about the notmuch mailing list