mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 20:34:16 +02:00
[view] improvement: displaying update sizes as localized numbers (update summary)
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user