summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
...
* 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.
* Add two messages to the test mail corpusLucas Hoffmann2018-12-03
| | | | | The test corpus holds mails that are used to test different problems with parsing or displaying mail.
* Assert some logging messages to silence themLucas Hoffmann2018-11-11
| | | | | The logging messages appear in between the test output. By asserting them they are hidden from the output.
* Fix deprecation warnings for unittestsLucas Hoffmann2018-11-11
|
* Merge pull request #1306 from lucc/fix-1303Dylan Baker2018-10-10
|\ | | | | Check the return code from sendmail
| * Check the return code from sendmailLucas Hoffmann2018-09-22
| |
* | 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.
* Add a simple test for the send_mail functionLucas Hoffmann2018-08-16
| | | | | This is just a simple test for the bug reported in #1303. The interesting test is marked as a known failure.
* 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
|
* commands/globals: Convert CallCommand.apply to a coroutineDylan Baker2018-08-02
| | | | | | This allows it to easily wrap calls that are themselves coroutines, while it's still able to wrap synchronous calls. This fixes the async test and allows hooks that are coroutines to work.
* tests: Add a couple of tests for the CallCommand classDylan Baker2018-08-02
| | | | | This basically just tests that a synchronous and an asynchronous function work, (the async doesn't yet).
* 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: use "gpg2" instead of "gpg" commandDylan Baker2018-08-01
| | | | | | | | | Some distro (notably debian and derived distros like ubuntu) still package the obsolete gpg 1.x series as "gpg", and provide the modern gpg 2.x tool as "gpg2". Other distros don't package gpg 1.x anymore, but most seem to provide a gpg2 symlink, so this should be safe for them. This is verified working on Archlinux, and is required to make these two tests work on Ubuntu 16.04 Xenial.
* tests: drop remaining references to twisted from unit testsDylan Baker2018-07-26
| | | | all unittests now use asyncio and the standard unittest framework.
* ui: switch ui.prompt and ui.choice to use asyncio.FuturesDylan Baker2018-07-26
| | | | | | | | | | | asyncio's Futures are much like twisted's Deferreds, they represent a value that is not yet available, and they can be awaited like a coroutine. For the moment we still need to return a deferred because the twisted eventloop doesn't use Futures, it uses Deferreds; once we can remove twisted's eventloop we can remove the conversion from a Future to a deferred.
* account: Convert send_mail function to coroutineDylan Baker2018-07-26
|
* tests/commands/global: use utilities.async_testDylan Baker2018-07-26
|
* tests/commands/envelope: use utilities.async_testDylan Baker2018-07-26
|
* tests/commands/utils: use utilities.async_testDylan Baker2018-07-26
|
* helper: use asyncio.subprocess instead of twistedDylan Baker2018-07-26
|
* utilities: Add a decorator for asyncio testsDylan Baker2018-07-26
| | | | | This decorator works to allow tests for pure asyncio coroutines to operate synchronously.
* commands/globals: implement ExternalCommand.apply as coroutineDylan Baker2018-07-26
| | | | | | Rather than returning a deferred in some cases, this makes the function a coroutine, in some cases it calls regular subprocess, in other cases it uses asyncio subprocess.
* commands/globals: Use asyncio coroutines instead of twisted deferredsDylan Baker2018-07-26
|
* command/envelope: use asyncio coroutines instead of twisted inlineCallbacksDylan Baker2018-07-26
|
* commands/globals: Convert Address to string for email.utilsDylan Baker2018-07-25
| | | | | | | | Email utils apparently assumes it's getting a string, and calls encode directly. This can only be hit if you have a single account configured, not with multiple accounts. Fixes #1277
* 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.
* update theme spec, default theme and testsPatrick Totzke2018-07-24
| | | | | | | | | | This patchseries adds a new buffer type for displaying notmuch's saved querystrings. This commit adds the respective theming attributes used in the new buffer. They are just copies of the taglist buffer really. THIS BREAKS COMPATIBILITY WITH USER THEMES! The theme files need to be updated to also have these new attributes in order to conform with the updated spec.
* Merge pull request #1252 from pazz/update-envelope-keysDylan Baker2018-07-24
|\ | | | | fix: automatically update envelope gpg keys only if requested. see #1228
| * rename function that updates gpg keys in envelopesPatrick Totzke2018-06-21
| |
* | Remove pre py3 monkey patchLucas Hoffmann2018-07-22
| |
* | Merge pull request #1266 from mjg/message-from-bytesDylan Baker2018-07-17
|\ \ | | | | | | Message from bytes
| * | 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).
* | | Add simple test case for helper.parse_mailtoJohannes Löthberg2018-07-16
|/ / | | | | | | Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
* / update tests for SettingsManagerPatrick Totzke2018-06-21
|/ | | | | | | - SettingsManagers is now instantiated without config paths and instead `read_[notmuch]config` is called separately - test_no_user_setting_* are removed, because we do not need to test what config path SettingsManager uses anymore (this is now explicit)
* 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
|
* Revert "Extract some context managers for patch objects."Dylan Baker2018-04-24
| | | | | | | | This reverts commit d01d2e51da45dd87f0abf98b8a856f3b3de69153. I don't think that this patch really improved readability that much. The right solution is to split ComposeCommand.apply so we don't need so many mocks.
* Wrap long statements on open-bracket syntax.Ben Finney2018-04-23
|
* Refactor some long statements to allow shorter lines.Ben Finney2018-04-23
|
* Rename some test functions to have shorter names.Ben Finney2018-04-23
|
* Extract some context managers for patch objects.Ben Finney2018-04-23
| | | | This allows writing less-nested statements.
* 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.
* drop bytes support from AddressDylan Baker2018-03-06
| | | | | | We don't want to be comparing bytes anyway, the decode would use utf-8, and that isn't right. Instead make the caller convert to a str of Address first.