summaryrefslogtreecommitdiff
path: root/bindings/python-cffi/tests
AgeCommit message (Collapse)Author
2022-01-09Merge tag '0.34.3'David Bremner
notmuch 0.34.3 release
2022-01-09bindings/python-cffi: search for config by defaultDavid Bremner
The previous (pre-0.34.2) constructor searched for a config file but only if the database path was not specified, and only to retrieve database.path. Neither of the available options (CONFIG.SEARCH or CONFIG.NONE) matches this semantics exactly, but CONFIG.SEARCH causes less breakage for people who relied on the old behaviour to set their database.path [1]. Since it also seems like the friendlier option in the long run, this commit switches to CONFIG.SEARCH as default. This requires a certain amount of updating the pytest tests, but most users will actually have a config file, unlike the test environment. [1]: id:87fsqijx7u.fsf@metapensiero.it
2022-01-01bindings/python-cffi: add matched property to message objectsDavid Bremner
Existing users of the legacy python bindings use message.get_flags(Message.FLAG.MATCH) to determine which messages in a thread matched. Since the bindings don't provide get_flags anymore, they should provide a property analogous to the existing "excluded" property.
2021-12-05Fix error message when using notmuch_status_to_stringFloris Bruynooghe
The python exception class was incorrectly loading the error message which resulted in unprintable exception objects.
2021-02-06lib: introduce notmuch_database_create_with_configDavid Bremner
This takes a config path parameter, and can use that to decide the new database location.
2020-08-09Fix typosJonas Bernoulli
2020-06-16Support aborting the atomic contextFloris Bruynooghe
Since it is possible to use an atomic context to abort a number of changes support this usage. Because the only way to actually abort the transaction is to close the database this must also do so. Amended by db: Note the limitation requiring close is a limitation of the underlying notmuch API, which should be fixed in a future notmuch release.
2020-06-16Make messages returned by Thread objects ownedFloris Bruynooghe
This reverses the logic of StandaloneMessage to instead create a OwnedMessage. Only the Thread class allows retrieving messages more then once so it can explicitly create such messages. The added test fails with SIGABRT without the fix for the message re-use in threads being present.
2020-06-15python config access: fix style and KeyError bugFloris Bruynooghe
This fixes some minor style/pep8 things and adds tests for the new config support. Also fixes a bug where KeyError was never raised on a missing key.
2020-06-15Add missing set methods to tagsetsFloris Bruynooghe
Even though we use collections.abc.Set which implements all these methods under their operator names, the actual named variations of these methods are shockingly missing. So let's add them manually.
2020-02-19Drop deprecated/unused crypto.gpg_pathDaniel Kahn Gillmor
crypto.gpg_path was only used when we built against gmime versions before 3.0. Since we now depend on gmime 3.0.3 or later, it is meaningless. The removal of the field from the _notmuch_config struct would be an ABI change if that struct were externally exposed, but it is not, so it's safe to unilaterally remove it. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-12-03python-cffi: use shutil.whichDavid Bremner
I was supposed to amend the original patch that added this function, but somehow I botched that. The original version runs, so make an extra commit for the tidying.
2019-12-03Rename package to notmuch2Floris Bruynooghe
This is based on a previous discussion on the list where this was more or less seen as the least-bad option.
2019-12-03Show which notmuch command and version is being usedFloris Bruynooghe
This add the notmuch version and absolute path of the binary used in the pytest header. This is nice when running the tests interactively as you get confirmation you're testing the version you thought you were testing.
2019-12-03bindings/python-cffi: preserve environment for testsDavid Bremner
We'll need this e.g. to pass PATH to the pytest tests Based on the suggested approach in id:87d0eljggj.fsf@powell.devork.be
2019-12-03Introduce CFFI-based python bindingsFloris Bruynooghe
This introduces CFFI-based Python3-only bindings. The bindings aim at: - Better performance on pypy - Easier to use Python-C interface - More "pythonic" - The API should not allow invalid operations - Use native object protocol where possible - Memory safety; whatever you do from python, it should not coredump.