[tests/traffic] Fix tests for module traffic

This commit is contained in:
Tobias Witek 2020-03-06 07:03:18 +01:00
parent afa1645e60
commit bb2c92732e

View file

@ -14,10 +14,10 @@ class TestTrafficModule(unittest.TestCase):
def test_get_minwidth_str(self):
# default value (two digits after dot)
self.assertEqual(self.module.get_minwidth_str(), "1000.00MB")
self.assertEqual(self.module.get_minwidth_str(), "1000.00KiB/s")
# integer value
self.module._format = "{:.0f}"
self.assertEqual(self.module.get_minwidth_str(), "1000MB")
self.assertEqual(self.module.get_minwidth_str(), "1000KiB/s")
# just one digit after dot
self.module._format = "{:.1f}"
self.assertEqual(self.module.get_minwidth_str(), "1000.0MB")
self.assertEqual(self.module.get_minwidth_str(), "1000.0KiB/s")