Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various test fixes #420

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion misc/install-test-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
- gettext
- python3-polib
- libblockdev-part
- btrfs-progs
- dosfstools
- e2fsprogs
- xfsprogs
when: ansible_distribution == "Fedora"

- name: Update apt cache (Debian/Ubuntu)
Expand Down Expand Up @@ -66,6 +70,10 @@
- gettext
- python3-polib
- libblockdev-part2
- btrfs-progs
- dosfstools
- e2fsprogs
- xfsprogs
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Debian"

- name: Install Blivet dependencies not covered by PyPI (Ubuntu/Debian)
Expand Down Expand Up @@ -120,7 +128,9 @@
- python3-pip
- python3-polib
- libbd_part2
- btrfsprogs
- e2fsprogs
- xfsprogs
- adwaita-icon-theme
when: ansible_os_family == "Suse"

Expand Down Expand Up @@ -151,4 +161,4 @@
- name: Install pocketlint, blivet and pid using pip (openSUSE)
pip:
name: ['pocketlint', 'blivet', 'pid']
when: ansible_os_family == "Suse"
when: ansible_os_family == "Suse"
15 changes: 13 additions & 2 deletions tests/blivetgui_tests/add_dialog_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ def supported_filesystems():
return sorted(_fs_types, key=lambda fs: fs.type)


SUPPORTED_RAIDS = {"btrfs volume": set((raid.RAID0, raid.RAID1, raid.RAID10, raid.Single)),
"mdraid": set((raid.RAID0, raid.RAID1, raid.RAID4, raid.RAID5, raid.RAID6,
raid.RAID10, raid.Linear)),
"lvmlv": set((raid.RAID0, raid.RAID1, raid.RAID4, raid.RAID5, raid.RAID6,
raid.RAID10, raid.Linear, raid.Striped))}


@unittest.skipUnless("DISPLAY" in os.environ.keys(), "requires X server")
class AdvancedOptionsTest(unittest.TestCase):

Expand Down Expand Up @@ -355,7 +362,9 @@ def test_lvm_widgets(self):
self.assertFalse(add_dialog.md_type_combo.get_visible())
self.assertTrue(add_dialog.size_area.get_sensitive())

def test_btrfsvolume_widgets(self):
@patch("blivetgui.dialogs.add_dialog.supported_raids", return_value=SUPPORTED_RAIDS)
@patch("blivetgui.dialogs.widgets.supported_raids", return_value=SUPPORTED_RAIDS)
def test_btrfsvolume_widgets(self, *args): # pylint: disable=unused-argument,arguments-differ
parent_device = self._get_parent_device()
free_device = self._get_free_device(parent=parent_device)

Expand Down Expand Up @@ -800,7 +809,9 @@ def test_md_selection(self):
self.assertEqual(selection.size_selection.parents[1].selected_size, size)
self.assertEqual(selection.raid_level, raidtype)

def test_btrfs_selection(self):
@patch("blivetgui.dialogs.add_dialog.supported_raids", return_value=SUPPORTED_RAIDS)
@patch("blivetgui.dialogs.widgets.supported_raids", return_value=SUPPORTED_RAIDS)
def test_btrfs_selection(self, *args): # pylint: disable=unused-argument,arguments-differ
parent_device = self._get_parent_device()
free_device = self._get_free_device(parent=parent_device, size=Size("8 GiB"), is_free_region=False,
is_empty_disk=True)
Expand Down