Skip to content
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
17 changes: 9 additions & 8 deletions qui/updater/tests/test_intro_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ def test_populate_vm_list(

# i-th expectations value is an expected number of selected VMs after clicking on the
# colum header i times
N_QUBES = 17
@pytest.mark.parametrize(
"updates_available, expectations",
(
pytest.param((2, 6), (0, 2, 6, 14, 0)),
pytest.param((6, 0), (0, 6, 14, 0)),
pytest.param((2, 6), (0, 2, 6, N_QUBES, 0)),
pytest.param((6, 0), (0, 6, N_QUBES, 0)),
),
)
def test_on_header_toggled(
Expand All @@ -90,7 +91,7 @@ def test_on_header_toggled(
for vm in test_qapp.domains:
sut.list_store.append_vm(vm)

assert len(sut.list_store) == 14
assert len(sut.list_store) == N_QUBES

for i, row in enumerate(sut.list_store):
if i < updates_available[0]:
Expand All @@ -109,9 +110,9 @@ def test_on_header_toggled(
assert selected_num == expected
assert (
sut.checkbox_column_button.get_inconsistent()
and expected not in (0, 14)
and expected not in (0, N_QUBES)
or sut.checkbox_column_button.get_active()
and expected == 14
and expected == N_QUBES
or not sut.checkbox_column_button.get_active()
and expected == 0
)
Expand All @@ -130,7 +131,7 @@ def test_on_checkbox_toggled(
for vm in test_qapp.domains:
sut.list_store.append_vm(vm)

assert len(sut.list_store) == 14
assert len(sut.list_store) == N_QUBES

sut.head_checkbox.state = HeaderCheckbox.NONE
sut.head_checkbox.set_buttons()
Expand Down Expand Up @@ -188,7 +189,7 @@ def test_prohibit_start(
for vm in test_qapp.domains:
sut.list_store.append_vm(vm)

assert len(sut.list_store) == 14
assert len(sut.list_store) == N_QUBES

sut.head_checkbox.state = HeaderCheckbox.NONE
sut.head_checkbox.set_buttons()
Expand Down Expand Up @@ -422,7 +423,7 @@ def test_select_rows_ignoring_conditions(
for vm in test_qapp.domains:
sut.list_store.append_vm(vm)

assert len(sut.list_store) == 14
assert len(sut.list_store) == N_QUBES

result = b""
if tmpls_and_stndas:
Expand Down
8 changes: 5 additions & 3 deletions qui/updater/tests/test_summary_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_on_header_toggled(
sut.head_checkbox._allowed[0] = AppVMType.SERVICEVM
service_num = 3
sut.head_checkbox._allowed[1] = AppVMType.NON_SERVICEVM
non_excluded_num = 8
non_excluded_num = 10

sut.head_checkbox.state = HeaderCheckbox.NONE

Expand Down Expand Up @@ -176,9 +176,9 @@ def test_on_checkbox_toggled(


# expected data based on test_qapp setup
UP_VMS = 9
UP_VMS = 11
UP_SERVICE_VMS = 3
UP_APP_VMS = 6
UP_APP_VMS = 8


@pytest.mark.parametrize(
Expand Down Expand Up @@ -379,6 +379,8 @@ def test_perform_restart(
"sys-net",
"sys-usb",
"default-dvm",
"test-alt-dvm",
"test-alt-dvm-running",
"test-blue",
"test-red",
"test-vm",
Expand Down