diff options
Diffstat (limited to 'ttystatus/percent_tests.py')
-rw-r--r-- | ttystatus/percent_tests.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ttystatus/percent_tests.py b/ttystatus/percent_tests.py index 29c7cb4..9ffe0b9 100644 --- a/ttystatus/percent_tests.py +++ b/ttystatus/percent_tests.py @@ -24,18 +24,21 @@ class PercentDoneTests(unittest.TestCase): def setUp(self): self.w = ttystatus.PercentDone('done', 'total', decimals=1) + def test_is_not_static_width(self): + self.assertFalse(self.w.static_width) + def test_shows_zero_value_initially(self): - self.assertEqual(str(self.w), '0.0 %') + self.assertEqual(self.w.render(0), '0.0 %') def test_sets_value(self): - self.w.update({ 'done': 50, 'total': 100 }, 999) - self.assertEqual(str(self.w), '50.0 %') + self.w.update({ 'done': 50, 'total': 100 }) + self.assertEqual(self.w.render(0), '50.0 %') def test_handles_empty_strings_as_values(self): - self.w.update({ 'done': '', 'total': '' }, 999) - self.assertEqual(str(self.w), '0.0 %') + self.w.update({ 'done': '', 'total': '' }) + self.assertEqual(self.w.render(0), '0.0 %') def test_handles_zero_total(self): - self.w.update({ 'done': 0, 'total': 0 }, 999) - self.assertEqual(str(self.w), '0.0 %') + self.w.update({ 'done': 0, 'total': 0 }) + self.assertEqual(self.w.render(0), '0.0 %') |