]> git.notmuchmail.org Git - notmuch/commitdiff
python test "compare message ids"
authorPatrick Totzke <patricktotzke@googlemail.com>
Mon, 2 Jan 2012 14:51:27 +0000 (14:51 +0000)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Sun, 8 Jan 2012 12:46:50 +0000 (13:46 +0100)
Introduces a second (trivial) test for the python
bindings that searches for message ids and compares
the output with that of `notmuch search`.

test/python

index c318cc10ceea69f6c4c4f42e6a47afb9a62c0701..6018c2d0ad134e1b1bdad765e62b235e48afa618 100755 (executable)
@@ -15,4 +15,17 @@ for t in q_new.search_threads():
 EOF
 notmuch search --sort=oldest-first --output=threads tag:inbox | sed s/^thread:// > EXPECTED
 test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "compare message ids"
+test_python <<EOF
+import notmuch
+db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY)
+q_new = notmuch.Query(db, 'tag:inbox')
+q_new.set_sort(notmuch.Query.SORT.OLDEST_FIRST)
+for m in q_new.search_messages():
+    print m.get_message_id()
+EOF
+notmuch search --sort=oldest-first --output=messages tag:inbox | sed s/^id:// > EXPECTED
+test_expect_equal_file OUTPUT EXPECTED
+
 test_done