]> git.cworth.org Git - obsolete/notmuch-old/blobdiff - test/python
test: add tests for python bindings
[obsolete/notmuch-old] / test / python
diff --git a/test/python b/test/python
new file mode 100755 (executable)
index 0000000..179427b
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+test_description="python bindings"
+. ./test-lib.sh
+
+add_email_corpus
+
+test_begin_subtest "compare thread ids"
+python <<EOF | sort > OUTPUT
+import notmuch
+db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE)
+q_new = notmuch.Query(db, 'tag:inbox')
+for t in q_new.search_threads():
+    print t.get_thread_id()
+EOF
+notmuch search --output=threads tag:inbox | sed s/^thread:// | sort > EXPECTED
+test_expect_equal_file OUTPUT EXPECTED
+test_done