summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* Merge pull request #1111 from dcbaker/submit/signcommand-testsDylan Baker2017-08-14
|\ | | | | Fix issue 1113
| * envelope: Allow signing if address is in "name <email>" formDylan Baker2017-08-11
| | | | | | | | | | | | | | | | | | Currently anything except "user@domain" (such as "User Name <user@domain>"), will not work with the sign command, because settings.get_account_by_address wants just the "user@domain" bit, and we don't split it. Fixes #1113
| * Add tests for issue 1113Dylan Baker2017-08-11
| | | | | | | | | | These tests exercise issue 1113, which has to do with extracting the mail correctly from the 'From' header.
| * tests: Add tests for SignCommandDylan Baker2017-08-10
| | | | | | | | | | I wrote these looking at a bug, but they turned out not to be helpful there, but they should be useful all the same.
* | commands: Don't try to sign_by_default without a gpg keyDylan Baker2017-08-11
| | | | | | | | | | | | Currently it's possible to set sign_by_default without setting a default key. This is obviously not a good plan for all sorts of reasons. This fixes the two failing tests from the last commit.
* | tests: Add a couple of tests for the commands/global moduleDylan Baker2017-08-11
|/ | | | | | | | | | | | | | | | | This adds tests to exercise #1110. These tests operated on a twisted async method, based on the inlineCallbacks decorator (which creates a deferred, but looks like synchronous code). The tests therefore have to use twisted's trial module for unittest. These seem to operate mostly correctly using the standard python unittest runner, pass and fail work right, but expected failure does not. Instead of an expected failure, you get pass. I really am not impressed with trial. After several hours of mucking with it I never got it to run any tests, just spit out errors or do nothing. pytest can run these tests just fine, and if we're going to change test runner I'll again say that pytest is much nicer to work with.
* Merge pull request #1089 from dcbaker/submit/sign-without-hintDylan Baker2017-07-27
|\ | | | | commands/envelope: Fall back to account for signing key
| * settings/manager: Extend the get_account_by_address with return_defaultDylan Baker2017-07-27
| | | | | | | | | | | | This new return_default flag (which is an optional and default to False) will try to return the default account if it cannot find an account matching the address hint.
* | db/utils: Support unicode in signaturesDylan Baker2017-07-24
| | | | | | | | | | | | Currently if a signature name has a non-ascii unicode character in it, the thread will fail to load because a UnicodeEncodeError. This patch fixes that by converting the str into unicode.
* | tests/db/utils: Add tests for unicode as uidsDylan Baker2017-07-24
| | | | | | | | One of these tests is known to fail, and marked as xfail.
* | tests/db/utils: share some mock biolerplateDylan Baker2017-07-24
| |
* | tests/utilities: Allow uid to be passed to make_uidDylan Baker2017-07-24
| |
* | tests/utilities: have make_key rely on make_uidDylan Baker2017-07-24
| |
* | tests: move shared helpers out of crypto module into common moduleDylan Baker2017-07-24
| |
* | tests: Add some basic tests for alot.db.utils.add_signature_headerDylan Baker2017-07-24
|/ | | | | These are pretty basic, but they do cover most of the conditions, even if they rely heavily on mocking.
* Tests for alot.settings.theme.Theme.get_attributeLucas Hoffmann2017-07-17
|
* Add another test for ExternalAddressbookLucas Hoffmann2017-07-17
|
* Test alot.settings.utils.resolve_attLucas Hoffmann2017-07-17
|
* tests/crypto: Add tests for the crypto moduleDylan Baker2017-07-15
| | | | | | This covers mosts of the functions in the crypto module, but doesn't bother with the hash_key function, which is slated for deletion in the port to python-gpg. It also doesn't cover re-raising errors.
* crypto: Fix error handling of signed messagesDylan Baker2017-07-11
| | | | | | | | | | gpgme.Context.verify doesn't raise an exception, instead it attaches the error as an attribute of the return value. This means that we've been returning that a signature is valid even when it isn't. This patch checks the attribute instead of try/excepting. Because there is a second bug (fixed in the next patch) signature verification will always fail with this patch.
* tests: Add tests for signing functions.Dylan Baker2017-07-11
| | | | | | | | This adds a couple of basic tests for the signing and verification of signatures code in the crypto module. This relies on the utilities module introduced in the last patch. One of the tests in here is expected to fail
* tests: Add a module with some extra utility helpersDylan Baker2017-07-11
| | | | | This module currently only contains a class that adds a class level addCleanup function (called addClassCleanup).
* Add tests for new commandsLucas Hoffmann2017-07-11
| | | | The test file is also renamed.
* settings: Add a reload methodDylan Baker2017-07-10
| | | | | | | | | | | This patch does a bit of refactoring to the Settings class for it's setup, and adds a reload method. The refactoring encapsulates the handling of NoneType for the read_*config methods, and reworks the constructor just a bit so that it doesn't rely on calling methods to create instance variables. The end result is slightly cleaner, and will be useful for adding a reload command to alot itself.
* tests: fix typo in module name envelop -> envelopeDylan Baker2017-07-10
|
* tests: rename command/envelope_tests to command/envelope_testDylan Baker2017-07-10
| | | | makes pylint happier to run tests, doesn't affect main pytest.
* tests: rename settings/manager.py -> settings/manager_test.pyDylan Baker2017-07-10
| | | | Or it wont be picked up by some test discovery methods.
* Use stdlib functions in db.utils.encode_headerLucas Hoffmann2017-06-30
| | | | | | | Instead of manual parsing with regexp and manual string formatting the functions from email.utils are used. This fixes some small inconsistencies with addresses with empty realnames and with commas in realnames.
* Add more tests for db.utils.encode_headerLucas Hoffmann2017-06-30
|
* Add tests for addressbook.AddressBookLucas Hoffmann2017-06-23
|
* determine_sender: Add more testsLucas Hoffmann2017-06-23
|
* Use account instead of realname to break loopsLucas Hoffmann2017-06-23
| | | | | | | | This fixes a bug in determine_sender where an account that did match but did not have a realname set was "not found" in case force_realname was set. Helped-By: Pol Van Aubel <dev@polvanaubel.com>
* Add test for force_realname settingsLucas Hoffmann2017-06-23
| | | | The second test case exemplifies a bug in determine_sender.
* Remember matched account explicitlyLucas Hoffmann2017-06-22
| | | | | Otherwise the next account in the for loop might have been returned if the account was found to match with its last alias.
* determine_sender: test if account matches addressLucas Hoffmann2017-06-22
| | | | | This test case exemplifies a bug in determine_sender. The address is matched correctly but the wrong account is associated with it.
* Add first test for commands.thread.determine_senderLucas Hoffmann2017-06-22
|
* Add helper function to quote test stringsLucas Hoffmann2017-06-21
|
* Add test for db.utils.decode_headerLucas Hoffmann2017-06-21
|
* Add test for db.utils.encode_headerLucas Hoffmann2017-06-21
|
* Add test for db.utils.extract_headersLucas Hoffmann2017-06-21
|
* Add test for db.utils.is_subdir_ofLucas Hoffmann2017-06-21
|
* Add test for db.utils.get_paramsLucas Hoffmann2017-06-21
|
* Add crypto tests that don't need a keyringLucas Hoffmann2017-06-21
|
* Clean up temp file after testLucas Hoffmann2017-06-08
|
* Correct membership testLucas Hoffmann2017-06-08
|
* Split up test case to see expected failureLucas Hoffmann2017-06-08
|
* Add tests for addressbook classesLucas Hoffmann2017-06-08
|
* Merge pull request #1061 from lucc/tests/settings-managerLucas Hoffmann2017-06-08
|\ | | | | add some first tests for settings.manager.SettingsManager
| * Add simple tests for settings methods for notmuch settingsLucas Hoffmann2017-06-06
| |
* | tests: Add some basic test for AccountDylan Baker2017-06-07
|/ | | | | This doesn't cover the actually complex part of the of the module, but it's a few basic tests.