2 test_description="python bindings"
3 . ./test-lib.sh || exit 1
5 test_require_external_prereq ${NOTMUCH_PYTHON}
9 test_begin_subtest "compare thread ids"
12 db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY)
13 q_new = notmuch.Query(db, 'tag:inbox')
14 q_new.set_sort(notmuch.Query.SORT.OLDEST_FIRST)
15 for t in q_new.search_threads():
16 print (t.get_thread_id())
18 notmuch search --sort=oldest-first --output=threads tag:inbox | sed s/^thread:// > EXPECTED
19 test_expect_equal_file OUTPUT EXPECTED
21 test_begin_subtest "compare message ids"
24 db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY)
25 q_new = notmuch.Query(db, 'tag:inbox')
26 q_new.set_sort(notmuch.Query.SORT.OLDEST_FIRST)
27 for m in q_new.search_messages():
28 print (m.get_message_id())
30 notmuch search --sort=oldest-first --output=messages tag:inbox | sed s/^id:// > EXPECTED
31 test_expect_equal_file OUTPUT EXPECTED
33 test_begin_subtest "get non-existent file"
36 db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY)
37 print (db.find_message_by_filename("i-dont-exist"))
39 test_expect_equal "$(cat OUTPUT)" "None"