summaryrefslogtreecommitdiff
path: root/tests/db
Commit message (Collapse)AuthorAge
...
* tests/db/thread: Fix tests for py3kDylan Baker2018-03-01
|
* 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.
* 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.
* db/utils: Allow encrypted messages to be put in mixed payloads as wellDylan Baker2017-08-17
| | | | | | | | Since a multipart/mixed can contain anything that a normal message could, this should be allowed. The only case that I can think of this actually happening is if an email server takes the original message, puts it in a multipart/mixed, and then attaches it's own message, like on of the annoying "this mail scanned for viruses by <product>".
* db/utils: Handle multipart/signed inside multipart/mixedDylan Baker2017-08-17
| | | | | | | | It is possible (and actual mail clients such as kmail do) to embed a multipart/signed within a multipart/mixed (this is briefly mentioned in the acknowledgements of RFC 3156, and is perfectly valid according to RFC 1341, which says that a multipart/mixed is exactly like a top level message, except that the header may be empty.
* tests/db/utils: Add tests for encapsulating gpg messagesDylan Baker2017-08-17
| | | | | | | It is valid to encapsulate the multipart/signed and multipart/encrypted payloads in a multipart/mixed payload. All of these tests currently fail.
* db/utils: Don't attach invalid signature to unsigned but encrypted messagesDylan Baker2017-08-17
| | | | | | The logic in the comment is faulty. There are perfectly legitimate reasons to encrypt but not sign a message, some of them are fleshed out in the previous commit.
* tests/db/utils: Add tests for message_from_fileDylan Baker2017-08-17
| | | | | | | | | | | | | | | | | | | | This class tests most of the function fairly thoroughly. There are a couple of error cases that are untested, but could be tested fairly easily with some mocking. There is one test marked as expected failure. In this case I disagree with what alot does, though there probably isn't a canonical correct behavior. Specifically, if a message is encrypted but unsigned, we generate a header that says the signature is invalid. This seems incorrect for a number of reasons. First, since there is no signature, it cannot be invalid. Second, the reasoning is that it "seems suspicious" that someone would encrypt but not sign a message. This is silly, there are plenty of people who encrypt but don't sign their messages, since signing and encrypting have two totally different purposes. Signatures verify who *wrote* the message, but encryption verifies who *reads* the message. People who need some level of deniability about who wrote the message, but not about who read it (like a political activist or whistle blower) might encrypt but not sign.
* 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: 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: fix typo in module name envelop -> envelopeDylan Baker2017-07-10
|
* 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 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
|
* Use absolute_imports from __future__Lucas Hoffmann2017-01-18
|
* Port old doctests to unittest: alot.db.envelopeLucas Hoffmann2017-01-18
|
* typoPatrick Totzke2016-12-24
|
* db/thread: don't create multiple lists to sortDylan Baker2016-12-21
| | | | | | | | | | | | | | | Currently this function takes a list, splits into two lists based on whether or not a function returns None, sorts the list that isn't None, and then appends the list of None to the end. This creates 4 new concrete lists on each method call, requires the use of 3 filter + lambda pairs, and calls list.sort(). Pretty complicated and inefficient. This patch replaces that with a single sorted() function call with a kay function that replaces None with a value that is guaranteed to sort less than what Message.get_date() will return, but will not cause a comparison to None (which is an error in Python 3.x). This is all based on iterators and avoids the need for filter or list concatenation. This should result in only one new list being created.
* tests: Add tests for alot.db.thread.Thread.get_authorDylan Baker2016-12-21