Commit graph

22 commits

Author SHA1 Message Date
Scott Mcdermott
05724a9d21 Make python tests use timezone, py3.12 deprecated tz-less utcnow()
Python upstream is trying to eliminate tz-naive date functions that
imply anything to do with a timezone, even UTC.  They have deprecated
datetime.datetime.utcnow() in Python 3.12 and thus running tests emits
many warnings for us.

We switch to instantiate datetime objects taht are intended to reflect
UTC to have a timezone, or if we instantiate naive ones and then later
convert, we do the full conversion.

After the changes, the tests still work on Python 3.9, but now also on
Python 3.12 without warnings.

See PR description for #632 for more details.

Signed-off-by: Scott Mcdermott <scott@smemsh.net>
2024-09-13 15:45:11 +02:00
Thomas Lauf
6d79ea4a6d Update copyright statements
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2023-09-18 12:33:17 +02:00
Thomas Lauf
14bed139f6 Update copyrights
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2023-04-04 22:44:44 +02:00
Thomas Lauf
c80442c878 Make report 'totals.py' display data when no time range specified
Use interval array to determine whether there is data to display
Move interval truncation outside the loop, combine/rework 'no data' messages

Close #450

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2022-11-01 23:04:46 +01:00
Thomas Lauf
49c33591b8 Make report 'totals.py' truncate intervals to search range
Closes #505

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2022-11-01 18:32:56 +01:00
Thomas Lauf
29d3043f29 Update copyright ranges
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-05-27 21:11:32 +02:00
Thomas Lauf
ad58309159 Update Copyright
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2020-04-19 12:41:23 +02:00
Thomas Lauf
7fa7ca5f04 Remove vim annotations
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-12-11 10:20:33 +01:00
Thomas Lauf
f53e1cef6d Switch to python 3
- #259

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-12-11 10:20:32 +01:00
Michael Eischer
8053ccf68e Fix calculation of totals longer than a day
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.
2019-10-18 10:56:50 +02:00
Thomas Lauf
8b5a701eeb Require python2 not python2.7 for tests
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-06-29 01:31:08 +02:00
Thomas Lauf
712b4b78b2 Revert "Run test with available python"
This reverts commit 6b89e122

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-06-24 21:10:57 +02:00
Thomas Lauf
6b89e12287 Run test with available python
- do not enforce python 2.7

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-06-22 21:21:11 +02:00
Thomas Lauf
b5acfed98f Refactor totals.py
- add main
- move algorithm to function
- use __future__ module
- introduce new style formatting
- restructure test_totals.t accordingly
- add test for empty range
- add tests for colored output
2018-05-10 19:22:34 +02:00
Thomas Lauf
147865b50b Fix time output in totals.py
- Convert UTC time to local time in output
- Change single quote to double quote
- Use new style python formatting
- Make tests use current time
- Fix test for open interval
2018-05-09 18:25:16 +02:00
Simon Ruderich
2271bd9eea Use https:// link for opensource.org 2018-03-16 23:11:08 +01:00
Thomas Lauf
63285c085d #111 Make test_totals.t run at any time 2018-03-08 20:37:27 +01:00
Thomas Lauf
946ac0ad68 Refactor test
- allow for jitter to stabilize test
- use triple quote strings
2018-03-07 21:45:25 +01:00
Thomas Lauf
b46ac77f64 Add test for case with open interval 2018-02-18 22:58:08 +01:00
Thomas Lauf
25c0dd4492 Optimize imports, reformat test input 2018-02-18 22:57:05 +01:00
Paul Beckingham
88d644d193 Copyright 2018 2017-12-31 19:37:13 -05:00
Thomas Lauf
8ad54f9bfd TI-40: totals.py extension script fails with an error
- Improve totals.py extension script:
- Fix display issue if tags are shorter than string 'Totals'
- Fix issue when totals.py is called on empty database
- Add tests: test_totals.t
2017-02-14 23:33:02 +01:00