summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* Move screen stop/start logic into context manager.Thomas Nixon2018-02-19
| | | | | | | As well as reducing duplication and adding screen size detection to :pipeto and :pyshell, this ensures that the screen is always restarted, resulting in cleaner error handling if an error occurs while the screen is stopped.
* Move mock ui creation to function.Thomas Nixon2018-02-19
|
* Add test: template not decoded properly.Julian Mehne2018-02-15
|
* Expand environment variables when reading the config file.Julian Mehne2018-01-23
|
* Set changed values in mock.patch.dict call itself.Julian Mehne2018-01-23
|
* Rename get_env to get_xdg_env and clarify docstring.Julian Mehne2018-01-23
|
* Store settings in alot.rc.spec.Julian Mehne2018-01-21
| | | | | - allows users to use $XDG_CONFIG_HOME, as well - stores information in single places.
* Fix empty XDG_* environment variables.Julian Mehne2018-01-21
| | | | | | | | | | | | Use fallback, if an enviroment variable is unset *or* empty. Bug: - XDG_CONFIG_HOME='' alot Problem: Does not find the configuration file (among others), because os.environ.get('XDG_CONFIG_HOME', '~/.config') returns '', instead of '~/.config'.
* De-duplicate code with helper function.Julian Mehne2018-01-21
|
* Use any() instead of a for loop with a break statementLucas Hoffmann2018-01-09
|
* Move code out of with blockLucas Hoffmann2018-01-08
| | | | | The code doesn't need the context manager to be active, hence it can run outside of the with block.
* Use message of test assert function instead of print()Lucas Hoffmann2018-01-08
| | | | | This makes it possible to silence the test output with normal unittest settings (e.g. command line parameters).
* Log unknown settings in configuration and theme files.Julian Mehne2018-01-08
|
* Fix typos in tests.Julian Mehne2018-01-07
|
* Allow regex special characters in tagstrings.Julian Mehne2017-12-02
| | | | | | | | | | | | | | | Fixes the following crashes: 1. tag completion with regex special chars :search tag:[<tab> 2. Changing tag representation of an (existing) tag with regex special chars: [tags] [[my**tag]] normal = '','', 'white','light red', 'white','#d66' 3. Contact completion with regex special chars and no external command: To:**foo<tab>
* add test for argparse validatorPatrick Totzke2017-11-08
|
* tests/commands/utils: Add encrypt to self testsRuben Pollan2017-09-26
|
* tests/commands/utils: Add tests for alot/commands/utils.pyDylan Baker2017-09-25
|
* db/message: Try to use the 'Sender' header if the 'From' header is nullDylan Baker2017-09-06
| | | | This makes drafts display correctly.
* db/message: Don't set sender to ''Dylan Baker2017-09-06
| | | | | | | If the message doesn't have a sender, try to come up with one. If the message has the draft tag we known that the user is the sender, just use the default account as the from if we can't find one another way. If it doesn't have the draft tag just set the sending to 'Unknown'.
* tests/db/message: Add some tests for the message moduleDylan Baker2017-09-06
| | | | | These are just enough to look at the bug that will be fixed in the patches that follow.
* account: Fix Address comparison to b'' and u''Dylan Baker2017-09-06
| | | | | | | | | | | This uses a try/except because comparing an address to an empty string should be a fairly uncommon event and try/except will be faster than `if '@' not in other` in the case where '@' is in other. This stops alot from crashing if there is no 'From' header in the email. Outlook generates drafts without a 'From' header. Fixes #1050
* tests/account: Add test for comparing to empty stringDylan Baker2017-09-06
|
* Merge pull request #1108 from dcbaker/wip/fix-1107Patrick Totzke2017-08-30
|\ | | | | Handle servers that treat the user segment of an address as case insensitive
| * Use new Address classDylan Baker2017-08-28
| | | | | | | | | | | | | | This just wries the new Address class into alot for use, and fixes up a few places where such fixups are needed. Fixes #1107
| * account: Add an Address classDylan Baker2017-08-28
| | | | | | | | | | This class will encapsulate the logic of comparing email addresses and the rules of handling when capitalization is allowed and when it's not.
| * tests/settings/manager: Add test for case insensitivityDylan Baker2017-08-28
| | | | | | | | This currently fails as there is not way to toggle case sensitivity
* | Merge pull request #1136 from dcbaker/submit/more-db-utils-testsDylan Baker2017-08-30
|\ \ | |/ |/| more tests + cleanups
| * tests/db/utils: Add tests for message_from_stringDylan Baker2017-08-28
| |
| * tests/db/utils: Add tests for extract_body functionDylan Baker2017-08-28
| | | | | | | | | | | | there are probably still some corners with mailcap handling (parameters like copiousoutput) that are untested, but this covers a large swath of the functionality.
| * db/utils: Don't mark signature valid if there is no key to verifyDylan Baker2017-08-23
| |
| * tests/db/utils: Add some more coverage to add_signature_headersDylan Baker2017-08-23
| | | | | | | | | | There are a couple of pieces of this function that aren't covered, including a bug. yay bugs.
* | commands/globals: Only set stdin to a pipe if there is dataDylan Baker2017-08-23
| | | | | | | | | | | | | | | | | | | | Otherwise the editor will crash. I can't figure out for the life of me to test this. I thought that I would be able to do something like detect if stdin is a tty or something else, but that doesn't seem to work. Fixes #1137
* | 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.
* | Merge pull request #1135 from dcbaker/submit/external-command-testsDylan Baker2017-08-23
|\ \ | | | | | | Submit/external command tests
| * | 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.
* | alot/helper: Fix call_cmd_async polluting global environmentDylan Baker2017-08-22
| | | | | | | | | | | | | | | | | | | | An assignment `e = os.environ` creates a reference not a copy, which means that modifying one necessarily modifies the other. Using `dict.copy` creates a shallow copy (the keys and values are references, but the dicts are different objects), which means only modifications to mutable objects are shared. In the case of os.environ which only contains immutable objects like strings, bools, and numbers this isn't an issue.
* | tests/helper: Add tests for call_cmd_asyncDylan Baker2017-08-22
| |
* | tests/utilities: Add expected_failure decorator for twisted.trial testsDylan Baker2017-08-22
| | | | | | | | | | | | | | | | | | Twisted.trail.unittest doesn't provide an expectedFailure decorator, nor does it work with the one from the builtin library. Instead it relies on having a "todo" attribute set. This new utilities decorator simply sets that attribute to a string value (booleans don't work).
* | tests/helper_test.py: Add tests for helper.shortenDylan Baker2017-08-22
|/
* Merge pull request #1133 from lucc/fix/bug-1132Dylan Baker2017-08-22
|\ | | | | Fix #1132 by reverting part of fa3dd1b04567.
| * Use cStringIO.StringIO to fix #1132Lucas Hoffmann2017-08-21
| | | | | | | | | | | | | | | | | | This undoes a small subset of the changes from fa3dd1b04567c4ea03fa658c3838b569531c79f5 and thus fixes #1132. The io.BytesIO object was not able to handle the unicode header names that where returned by envelope.construct_mail, which in turn did just copy them from the envelope header.
| * Add failing test for alot.helper.email_as_string()Lucas Hoffmann2017-08-21
| | | | | | | | | | Since email_as_string uses io.BytesIO it can not handle the unicode header names that might result from a envelope.construct_mail().
* | Use a tuple to build a hash valueLucas Hoffmann2017-08-20
| | | | | | | | | | | | | | | | | | The old implementation would raise an error when the translated tag string was a unicode string (might be defined as an abbreviation in the users config). The official docs suggest this kind of implementation: https://docs.python.org/3/reference/datamodel.html#object.__hash__
* | Test hash() for TagWidget with unicode representationLucas Hoffmann2017-08-20
|/
* Merge pull request #1095 from dcbaker/submit/use-default-theme-if-no-configDylan Baker2017-08-17
|\ | | | | Load default settings even if a user config doesn't exist
| * settings: Load spec file even if config file is undefined.Dylan Baker2017-08-16
| | | | | | | | | | | | | | | | | | | | This is necessary even if the config file is None to ensure that the spec file is loaded Also mock out the setting.const module in the docs, otherwise they'll fail to generate. Fixes #1094
| * tests/settings/manager: Add tests for Null config filesDylan Baker2017-08-16
| | | | | | | | Which fail, per #1094