]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/python-cffi/tests/test_errors.py
Fix error message when using notmuch_status_to_string
[notmuch] / bindings / python-cffi / tests / test_errors.py
diff --git a/bindings/python-cffi/tests/test_errors.py b/bindings/python-cffi/tests/test_errors.py
new file mode 100644 (file)
index 0000000..c2519f8
--- /dev/null
@@ -0,0 +1,8 @@
+from notmuch2 import _capi as capi
+from notmuch2 import _errors as errors
+
+def test_status_no_message():
+    exc = errors.NotmuchError(capi.lib.NOTMUCH_STATUS_PATH_ERROR)
+    assert exc.status == capi.lib.NOTMUCH_STATUS_PATH_ERROR
+    assert exc.message is None
+    assert str(exc) == 'Path supplied is illegal for this function'