Since the recent switch to python3, I've been noticing that some of the tests
have been aborting with the following error when I use LANG=en_US instead of
LANG=en_US.UTF-8:
UnicodeEncodeError: 'latin-1' codec can't encode character '\u0455' in position 57: ordinal not in range(256)
Arguably, I should run with a unicode locale while running the test, but it
*looks* to me like the original ѕ was not intended.
When some of the individual tests fail to run, the `make test` target would
still pass since test/problems would not return an error which could hide the
fact that there are problems in the test.
With this change, if you do not have the python dateutil package, you will now
get output like:
'test_totals.t' failed to run any tests.
Passed: 975
Failed: 1
Unexpected successes: 0
Skipped: 0
Expected failures: 0
Runtime: 4.83 seconds
Or, if you do not have UTF-8 encoding set in your language you will get
something like:
'track.t' failed to run all tests.
'stop.t' failed to run all tests.
'start.t' failed to run all tests.
'test_totals.t' failed to run all tests.
Passed: 941
Failed: 50
Unexpected successes: 0
Skipped: 0
Expected failures: 0
Runtime: 4.55 seconds
This test updates one of the existing tests to make sure that an non-synthetic
interval in addition with the synthetic intervals can be moved properly.
Since the switch to python3, there is another method that starts with "test"
higher up in the stack which produces unhelpful file / line information on a
failed test like:
ERROR: CommandError on file /usr/lib/python3.6/unittest/case.py line 59 in testPartExecutor: 'yield':
This change restores the previous behavior from before the switch to python 3.
Recently I was trying to stop an interval that I had left open over the
weekend, but I had already started a new interval at the beginning of the
week. The error I was received was "The end of a date range must be after the
start." which was confusing to me.
After a few moments I realized I should have been using the modify command.
Now the stop command will suggest modify if someone attempts to use stop for
this purpose.
If there are escaped quotes in the tags database file, when the file is read,
then written, additional escape characters were inserted.
For example:
When tag 'a "test"' is written, it gets stored as 'a \"test\"'. Then it's read
back in that form, but the next time it's serialized to disk, the quotes would
be escaped again resulting in 'a \\"test\\"' which has the effect of removing
the escapes for the double-quotes.
Escapes the quotes for the annotations in the data file, and when
converting an interval to JSON.
The quotes in the annotations were already dequoted in
IntervalFactory::fromSerialization, so we only needed to quote the strings
when serializing or dumping to JSON.
datetime.timedelta stores days, seconds and microseconds. Therefore the
seconds attribute only stores timedeltas of less than 24 hours. Use
total_seconds() instead which properly accounts for the days part.
- somehow cpp-testfiles are not compiled when calling make in the test directory
- make install is required to be executed before make test, because we need access to man pages (help.t)
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>