Laurent Monin
54801d97df
Now that we default to 'C' locale for tests, remove redundant setups
2023-06-11 16:56:37 +02:00
Philipp Wolfer
1853572a99
Replace some list usages with tuples, sets or iterators
2022-04-13 10:17:22 +02:00
Laurent Monin
2f6479747d
Update headers
2022-02-07 09:41:57 +01:00
Laurent Monin
14ce07756e
Update Copyright headers, with the help of fix-headers.py script
2021-11-10 21:38:54 +01:00
Philipp Wolfer
fb83a8e76b
Enable flake8 E265: Block comment should start with '# '
...
Most changes involve replacing non-breaking space with a simple space after the #.
2020-05-13 11:03:13 +02:00
Philipp Wolfer
ee8b88cf2a
Avoid using ambiguous variable name "l"
...
Fixes the issue E741 reported by flake8 >= 3.8.
https://www.flake8rules.com/rules/E741.html
2020-05-12 19:33:13 +02:00
Laurent Monin
6b5e852a60
Run fix-header on *.py
2020-02-24 10:25:09 +01:00
Laurent Monin
3f25bda3c8
Fix a bunch of flake8 warnings, mostly cosmetic changes
2020-02-21 21:43:40 +01:00
Laurent Monin
498c8eab1b
Add mktmpdir method to PicardTestCase, and use it more widely
2020-02-08 18:04:39 +01:00
Laurent Monin
b7389a6445
Tests: ensure temporary directories and files are removed after tests
...
- QSettings object needs special care, as file was re-created on exit
- Append a cleanup function as soon as possible to ensure temporary dirs & files are removed in any case
- prefer addCleanup() over tearDown(), keeping creation and cleanup together
2020-02-08 18:04:39 +01:00
Philipp Wolfer
b11b07160d
Fixed up left-over Python 2 unicode string declarations
2019-09-26 10:58:54 +02:00
Laurent Monin
be7b4d70bb
assertEquals() was deprecated in favor of assertEqual()
2019-09-13 19:31:20 +02:00
Laurent Monin
3089dafe4c
Merge pull request #1268 from zas/bytes2human_coverage
...
Increase test coverage of bytes2human
2019-09-08 10:57:46 +02:00
Laurent Monin
270a0cfe38
Increase test coverage of bytes2human
2019-09-08 10:28:40 +02:00
Philipp Wolfer
1f19ee4b94
Increased test coverage of format tests
2019-09-07 17:46:23 +02:00
Philipp Wolfer
dd4da2aa47
Updated isort config to put test imports in separate section
2019-04-04 08:32:22 +02:00
Wieland Hoffmann
e624aa121c
Make PicardTestCase the parent class of all tests
...
This brings the faketagger and, more importantly, settings reset to all of them.
2018-10-23 17:32:50 +02:00
Philipp Wolfer
ab576a5bb2
Don't use deprecated U file open mode
2018-10-23 11:15:30 +02:00
Sophist
bf4c08e004
Remove unneeded imports in test files
2017-05-17 11:02:24 +01:00
Sambhav Kothari
69251f2907
Fix decode error
2017-04-07 16:06:15 +05:30
Sophist
b80091b56e
Use Universal Newline Support instead.
2014-03-24 20:11:14 +00:00
Sophist
78d2ebf9a3
Strip CR as well as LF to avoid errors on Windows
2014-03-24 07:42:40 +00:00
Laurent Monin
7c6d3e9c3b
decimal(): fix missing parameter prec and update tests
2013-12-28 00:17:42 +01:00
Laurent Monin
7dd311697f
tests: PEP8 fixes
2013-07-03 03:37:24 +02:00
Laurent Monin
fdbed3f6c1
Remove fr_FR locale test, too much a requirement.
2013-06-18 12:24:09 +02:00
Laurent Monin
6de59d8ee9
Add functions to convert bytes to human readable form.
...
Binary and decimal modes are supported (MB and MiB ie.)
It supports i18n using gettext and locale.
Precision can be modified if needed, by default it is using 1 digit (if needed).
Extensive tests were written, the toughest was to make them work for
both default C locale and fr_FR.UTF-8 locale (ofc it is possible to test for more
locales...). If one locale isn't available on testing system, test is skipped.
fr locale was chosen because decimal point is replaced by a comma and byte units
becomes "octet" units (1.5 MB in english -> 1,5 Mo in french).
2013-06-09 14:23:23 +02:00