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>
This commit is contained in:
Thomas Lauf 2022-11-01 20:23:41 +01:00
parent 8e8df2aaa8
commit c80442c878
4 changed files with 48 additions and 21 deletions

View file

@ -53,7 +53,7 @@ class TestTotals(TestCase):
out = calculate_totals(input_stream)
self.assertEqual(['There is no data in the database'], out)
self.assertEqual(['No data to display'], out)
def test_totals_with_filled_database(self):
"""totals extension should print report for filled database"""
@ -254,7 +254,7 @@ class TestTotals(TestCase):
out = calculate_totals(input_stream)
self.assertEqual(['There is no data in the database'], out)
self.assertEqual(['No data to display'], out)
def test_totals_colored_with_filled_database(self):
"""totals extension should print report for filled database (colored)"""