summaryrefslogtreecommitdiff
path: root/tests/db
Commit message (Collapse)AuthorAge
* db/envelope: move to a new module "mail"Anton Khirnov2021-01-30
| | | | It has nothing to do with the database.
* db/envelope: switch to the "new" (EmailMessage) python APIAnton Khirnov2021-01-30
| | | | | | | | | | email.mime is a part of the old API, which does not mix well with the new one (i.e. when email.policy.SMTP is used), specifically when non-ASCII headers are used. Additionally, clean the APIs that accept either EmailMessage or a str to only expect EmailMessage. Supporting both just adds confusion and complexity.
* db/manager: Drop async methodDylan Baker2021-01-10
| | | | | | | | | | As far as I can tell using a separate process doesn't actually improve performance, it makes it worse. The work that we're passing off to the separate function isn't necessarily work that's well suited to being handed off, there isn't a lot of computation and the objects that need to be passed across the pipe are fairly large (at least when considering a pipe). Converting the function to a generator gives better performance and simplifies the implementation.
* db/manager: drop support for adding/removing queriesAnton Khirnov2020-05-08
| | | | | This is not implemented in notmuch2 and does not really belong in alot. It can be done better through the notmuch utility.
* Update tests.Anton Khirnov2020-03-05
| | | | Drop some tests for removed functions.
* db/message: remove unnecessary get_params()Anton Khirnov2020-03-05
|
* db/message: drop a useless getter.Anton Khirnov2020-02-27
|
* Update tests.Anton Khirnov2020-02-27
| | | | Drop useless db/thread test.
* db: rewrite the API for representing message treesAnton Khirnov2020-02-06
| | | | | It should be cleaner and easier to use, and eventually replace the custom tree walker in the thread display buffer.
* db/message: forbid instantiating Message with thread = NoneAnton Khirnov2020-02-06
| | | | It should always be instantiated from a Thread instance.
* Let python decode the message transfer encoding.Anton Khirnov2020-02-03
|
* Revert "db/manager: Drop async method"Anton Khirnov2020-01-02
| | | | This reverts commit e7e0c52db9093a9ecd9dcaa0766e66515a546a75.
* envelope: fix header key:value parsing regressionpacien2019-11-23
| | | | | Fixes an issue introduced in 45829f7956716638fe77989a50eb87d3ea34cace which made header values containing ':' break the parser.
* envelope: correctly handle folded headerspacien2019-11-23
|
* Remove unicode literals syntax from python2Lucas Hoffmann2019-11-06
|
* fix display of HTML-only mailsMichael J Gruber2019-09-06
| | | | | | | | "Prefer plain text" should mean just that, and not "ignore HTML even in the absence of a text part". 21c399ee ("Update to new (3.6) email message API", 2018-12-08) had introduced the "ignore" behaviour. Make it "prefer" again.
* tests: test prefer_text with HTML-only mailsMichael J Gruber2019-09-06
|
* db/manager: Drop async methodDylan Baker2019-08-15
| | | | | | | | | | As far as I can tell using a separate process doesn't actually improve performance, it makes it worse. The work that we're passing off to the separate function isn't necessarily work that's well suited to being handed off, there isn't a lot of computation and the objects that need to be passed across the pipe are fairly large (at least when considering a pipe). Converting the function to a generator gives better performance and simplifies the implementation.
* Use unittest.mock from the stdlibLucas Hoffmann2019-08-15
| | | | It was added to the stdlib in py3.3 and we already require 3.5.
* adjust tests to use the new EmailMessage APIPatrick Totzke2019-08-15
|
* remove duplicate and pointless testsPatrick Totzke2019-08-15
|
* remove unused importsPatrick Totzke2019-08-11
|
* tests: db.utils.formataddrPatrick Totzke2019-06-02
|
* tests: move tests for db.utils.clear_my_addressPatrick Totzke2019-06-02
|
* tests: move test for utils.ensure_unique_addressPatrick Totzke2019-06-02
|
* tests: add case for exchange formatted realnamesPatrick Totzke2019-05-27
|
* restore lenient libmagic decodingMichael J Gruber2019-02-07
| | | | | | | | 176cffcd ("refactor alot.db.utils.remove_cte", 2018-12-04) created a few problems with 8bit quoted-printable e-mails, see #1291 #1360. This commit restores the old libmagic fallback which did not cause this problem.
* Rename test filesLucas Hoffmann2019-01-29
| | | | | | | | The two main reasons are - to run `python3 -m unittest discover` without specifying a custom `--pattern *_test.py` - to include the test files automatically when generating the MANIFEST file.
* Add test case for new encoding problemsLucas Hoffmann2018-12-24
|
* refactor test_issue_1291Patrick Totzke2018-12-07
| | | | | | this is now test_char_vs_cte_mismatch; It checks if a mime part contains a character which is not encoded in the encoding declared in the Content-Transfer-Encoding header
* add test test_unknown_cte_valuePatrick Totzke2018-12-07
| | | | | that tests if a message with unknown content-transfer-encoding header, but otherwise correct ascii encoded payload, is warned about.
* tests: update test_malformed_cte_valuePatrick Totzke2018-12-07
| | | | | It now tests if malformed Content-Transfer-Encoding values are reported in the logs
* pep8 fixesPatrick Totzke2018-12-03
|
* Add test for #1301Lucas Hoffmann2018-12-03
| | | | | | This adds a test for detecting a malformed content-transfer-encoding (trailing semi-colon). It also changes the raised exception to the more appropriate ValueError.
* Add simple test to demonstrate #1291Lucas Hoffmann2018-12-03
| | | | This does just call the final bit of code that throws the exception.
* crypto: Use session-key to decrypt messages if present in the indexRuben Pollan2018-10-08
| | | | | | | | | | notmuch caches the OpenPGP session keys if configured to do so. See index.decrypt on: https://notmuchmail.org/manpages/notmuch-config-1/ Using the cached session key decryption of messages can be done without the need of having the private OpenPGP key. There is some speed up on decryption, mostly notable on long encrypted threads.
* db/utils: Replace encode_header with Message.add_headerDylan Baker2018-08-04
| | | | | Which appears to be capable of doing all the same things, but is in the stdlib instead of something we hand rolled.
* db: encode Header objects to strDylan Baker2018-08-04
| | | | | | | | | | | In python 3 with the use of Policy objects (other than the Compat32 object which maintains the previous (python 2.x and <=3.2) API) change the way headers work, and the old Header object is no longer used. This is rather convenient in that python now implements many of the rules required for sepcial header types, but it changes the API. This fixes that by encoding the Header objects to strings. Fixes #1289
* tests/db/envelope: Add tests for construct_mailDylan Baker2018-08-04
|
* helper: replace email_as_* with email builtinsDylan Baker2018-08-02
| | | | | | | | | | | | | | Python 3.3 added a new feature to the email module, policies (https://docs.python.org/3.5/library/email.policy.html). Policy objects allow precise control over how numerous features work when converting to and from str or bytes. With the `email.policy.SMTP` the behavior of email_as_bytes and email_as_string can be achieved using the builtin `.as_string()` and `.as_bytes()` methods, without custom code or the need to test it. Additionally these methods handle corner cases that we don't currently handle, such as multi-part messages with different encodings. Fixes #1257
* tests for alot.db.managerPatrick Totzke2018-07-24
| | | | | This adds a new TestCase for the database manager and adds a test for saving/reading named query strings to the database.
* rename message_from_ functionsMichael J Gruber2018-07-11
| | | | | | | | | | Our message_from_functions decrypt PGP encryped parts in addition to creating a message object (from bytes or file handles) and recognizing the encoding in one way or the other. Rename them before refactoring to make their function clearer and to distinguish them from the email.message_from_ functions (which do not decrypt).
* Remove old __future__ importsLucas Hoffmann2018-06-19
| | | | They are not needed for python >= 3.0.
* Fix bad refactor of a testDylan Baker2018-05-07
|
* Fix some formatting requests for @luccDylan Baker2018-04-24
|
* Wrap long statements on open-bracket syntax.Ben Finney2018-04-23
|
* Refactor some long statements to allow shorter lines.Ben Finney2018-04-23
|
* db/utils: decoded_headers will be passed str not bytesDylan Baker2018-03-12
| | | | | | | I had made the assumption early on that this would get bytes, but when I added `assert isinstance(header, bytes)` alot would crash on startup, changing `bytes` to `str` fixed that. I noticed this when trying to fix the warning generated in the logging call.
* Fix some of the quoted words tests for py3kDylan Baker2018-03-01
|
* fix a bunch of utils tests for py3kDylan Baker2018-03-01
| | | | | There are a few that are still broken because of bytes to unicode conversion, and this may not all be correct, but most of the tests pass