fix tests with slightly more realistic sizes
This commit is contained in:
parent
753a7c67b3
commit
d2a9f84b18
|
@ -26,8 +26,8 @@ class PartitionViewTests(unittest.TestCase):
|
||||||
model.fs_by_name = FilesystemModel.fs_by_name
|
model.fs_by_name = FilesystemModel.fs_by_name
|
||||||
info = mock.create_autospec(spec=StorageInfo)
|
info = mock.create_autospec(spec=StorageInfo)
|
||||||
info.name = 'disk-name'
|
info.name = 'disk-name'
|
||||||
info.size = 100
|
info.size = 100*(2**20)
|
||||||
info.free = 50
|
info.free = 50*(2**20)
|
||||||
disk = Disk.from_info(info)
|
disk = Disk.from_info(info)
|
||||||
return PartitionView(model, controller, disk, partition)
|
return PartitionView(model, controller, disk, partition)
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class PartitionViewTests(unittest.TestCase):
|
||||||
self.assertIsNone(view_helpers.find_button_matching(view, "Delete"))
|
self.assertIsNone(view_helpers.find_button_matching(view, "Delete"))
|
||||||
|
|
||||||
def test_delete_not_disabled_for_ordinary_partition(self):
|
def test_delete_not_disabled_for_ordinary_partition(self):
|
||||||
view = self.make_view(Partition(size=50))
|
view = self.make_view(Partition(size=50*(2**20)))
|
||||||
but, path = view_helpers.find_button_matching(view, "Delete", return_path=True)
|
but, path = view_helpers.find_button_matching(view, "Delete", return_path=True)
|
||||||
self.assertIsNotNone(but)
|
self.assertIsNotNone(but)
|
||||||
for w in path:
|
for w in path:
|
||||||
|
@ -53,7 +53,7 @@ class PartitionViewTests(unittest.TestCase):
|
||||||
self.fail("Delete button is disabled")
|
self.fail("Delete button is disabled")
|
||||||
|
|
||||||
def test_delete_disabled_for_boot_partition(self):
|
def test_delete_disabled_for_boot_partition(self):
|
||||||
view = self.make_view(Partition(size=50, flag="boot"))
|
view = self.make_view(Partition(size=50*(2**20), flag="boot"))
|
||||||
but, path = view_helpers.find_button_matching(view, "Delete", return_path=True)
|
but, path = view_helpers.find_button_matching(view, "Delete", return_path=True)
|
||||||
self.assertIsNotNone(but)
|
self.assertIsNotNone(but)
|
||||||
for w in path:
|
for w in path:
|
||||||
|
@ -63,7 +63,7 @@ class PartitionViewTests(unittest.TestCase):
|
||||||
self.fail("Delete button not disabled")
|
self.fail("Delete button not disabled")
|
||||||
|
|
||||||
def test_click_delete_button(self):
|
def test_click_delete_button(self):
|
||||||
partition = Partition(size=50)
|
partition = Partition(size=50*(2**20))
|
||||||
view = self.make_view(partition)
|
view = self.make_view(partition)
|
||||||
but = view_helpers.find_button_matching(view, "Delete")
|
but = view_helpers.find_button_matching(view, "Delete")
|
||||||
view_helpers.click(but)
|
view_helpers.click(but)
|
||||||
|
|
Loading…
Reference in New Issue