| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
The two main reasons are
- to run `python3 -m unittest discover` without specifying a custom
`--pattern *_test.py`
- to include the test files automatically when generating the MANIFEST
file.
|
|
|
|
|
| |
Fixes: https://github.com/pazz/alot/issues/1354
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
all unittests now use asyncio and the standard unittest framework.
|
| |
|
|
|
|
| |
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
|
|
|
|
| |
They are not needed for python >= 3.0.
|
| |
|
|
|
|
| |
In python 3 xrange is range, to get a list one must wrap range in list.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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'.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Since email_as_string uses io.BytesIO it can not handle the unicode
header names that might result from a envelope.construct_mail().
|
|
|
|
|
|
| |
Instead us %p, which differs only in the case of the am/pm.
Fixes #1048
|
|
|
|
|
| |
The OSError that is being caught should only be raised by the Popen
constructor: https://docs.python.org/3/library/subprocess.html#exceptions
|
| |
|
|
|
|
|
| |
This both fixes a test that failed (since stderr wasn't being set) and
simplifies the function to only have one path that uses a ternary.
|
|
|
|
| |
This even finds a bug!
|
|
|
|
|
|
|
|
|
|
|
|
| |
Technically a kilobyte (and it's derivatives like megabytes and
gigabytes) are defined as powers of 1000, while a kibibyte (and it's
derivatives like mibibytes and gibibytes) are defined as powers of 1024.
This patch fixes incorrect language and formatting in the humanize_size
function which defined a kilobyte as 1024.
See this wikipedia article for more information:
https://en.wikipedia.org/wiki/Kibibyte
|
|
|
|
|
|
|
| |
This doesn't implement complete coverage by any stretch, but it does
implement a number of tests for the helper module, including a few for
cases that are not handled correctly. These cases are marked as expected
failures.
|
| |
|
|
|