summaryrefslogtreecommitdiff
path: root/tests/commands
Commit message (Collapse)AuthorAge
...
* tests/commands/globals: Add tests for stdin handlingDylan Baker2017-08-23
|
* tests/commands/global: Fix testsDylan Baker2017-08-23
| | | | | These tests were wrong they would always pass, even if the code underneath was broken. With this fix they actually work.
* tests/commands/globals: Add tests for ExternalCommand when spawningDylan Baker2017-08-23
|
* tests/commands/global: Test ExternalCommand when not spawningDylan Baker2017-08-23
| | | | | | This doesn't test the spawn path, which is a little bit more complicated since it's running code in a thread instead of in the main thread.
* use @inlineCallbacks in tests for asynchronous methodsPatrick Totzke2017-08-16
| | | | | This decorates test methods that internally call a `cmd.apply()`, which represents asynchronous code that returns a `twisted.deferred`.
* Add tests for SendCommandLucas Hoffmann2017-08-16
| | | | | These test only check if get_account_by_address is called correctly. All other parts of `apply()` are left out.
* fix envelope testsPatrick Totzke2017-08-16
| | | | | | This instantiates an actual Envelope object instead of a Mock object for use in the tests for envelope commands. The tests then do not fail when they hit implicit getters of the form envelope['From'].
* 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.
* Add tests for new commandsLucas Hoffmann2017-07-11
| | | | The test file is also renamed.
* tests: rename command/envelope_tests to command/envelope_testDylan Baker2017-07-10
| | | | makes pylint happier to run tests, doesn't affect main pytest.
* 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
|
* tests: Instruct pylint to ignore a large swath of warningsDylan Baker2017-02-08
| | | | | | | | | There are a number of things pylint warns on that absolutely make sense to fix in production code, but for unittests they either don't matter (like naming variables "foo"), can't be fixed (TestCase methods that don't use self because they use a mock assert), or the descriptive names violate PEP8. These are annoying and create noise, so tell pylint to ignore them.
* commands/init_test: Basic tests for registerCommandDylan Baker2017-01-31
|
* Add tests for commands/envelopeDylan Baker2017-01-31
|
* Add tests for ReplyCommand.clear_my_addressLucas Hoffmann2017-01-25
|
* Fix test for ensure_unique_address with new quotingLucas Hoffmann2017-01-25
|
* Add some tests for ensure_unique_addressLucas Hoffmann2017-01-24
|
* Use absolute_imports from __future__Lucas Hoffmann2017-01-18
|
* Port old doctests to unittest: alot.commands.__init__Lucas Hoffmann2017-01-18