[view] improvement: displaying update sizes as localized numbers (update summary)

This commit is contained in:
Vinicius Moreira
2022-04-06 15:41:07 -03:00
parent 950d422094
commit 9daba19f61
4 changed files with 18 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import locale
from unittest import TestCase
from bauh.commons.view_utils import get_human_size_str
@@ -5,6 +6,12 @@ from bauh.commons.view_utils import get_human_size_str
class GetHumanSizeStrTest(TestCase):
def setUp(self):
try:
locale.setlocale(locale.LC_NUMERIC, None)
except:
print("Error: could not set locale.LC_NUMERIC to None")
def test__must_properly_display_B(self):
self.assertEqual('1023 B', get_human_size_str(1023))
self.assertEqual('-1023 B', get_human_size_str(-1023))