MCPcopy Create free account
hub / github.com/PabloLec/RecoverPy / test_full_workflow

Function test_full_workflow

tests/integration/test_full_workflow.py:21–324  ·  view source on GitHub ↗
(session_mocker, tmp_path: Path)

Source from the content-addressed store, hash-verified

19
20@pytest.mark.asyncio
21async def test_full_workflow(session_mocker, tmp_path: Path):
22 # Apply patches
23 session_mocker.patch(
24 "recoverpy.lib.env_check._is_user_root",
25 MagicMock(return_value=True),
26 )
27 session_mocker.patch(
28 "recoverpy.lib.env_check._is_linux",
29 MagicMock(return_value=True),
30 )
31 session_mocker.patch(
32 "recoverpy.lib.search.search_engine.get_device_info",
33 return_value=DeviceInfo(
34 size_bytes=1024 * 1024,
35 logical_sector_size=TEST_BLOCK_SIZE,
36 physical_sector_size=TEST_BLOCK_SIZE,
37 read_only=False,
38 is_block_device=True,
39 ),
40 )
41
42 # Launch the application
43 async with RecoverpyApp().run_test() as pilot:
44 # Test initialization of the app
45 assert pilot.app is not None
46 for screen in pilot.app.screens:
47 assert pilot.app.is_screen_installed(pilot.app.screens[screen])
48 assert pilot.app.screen.name == "params"
49 assert pilot.app.focused is not None
50 assert pilot.app.focused.id == "search-input"
51
52 await pilot.pause()
53 assert pilot.app.screen._partition_list is not None
54 assert (
55 len(pilot.app.screen._partition_list.list_items) == VISIBLE_PARTITION_COUNT
56 )
57 assert pilot.app.screen._start_search_button.disabled is True
58
59 # Test partition list default state
60 filter_checkbox = pilot.app.screen.query("Checkbox").only_one()
61 assert filter_checkbox is not None
62 assert filter_checkbox.value is True
63
64 items = list(pilot.app.screen.query("ListItem").results())
65 assert len(items) == VISIBLE_PARTITION_COUNT
66
67 # Test partition list unfiltered
68 filter_checkbox.toggle()
69 await pilot.pause()
70
71 assert filter_checkbox.value is False
72 await assert_with_timeout(
73 lambda: len(list(pilot.app.screen.query("ListItem").results()))
74 == UNFILTERED_PARTITION_COUNT,
75 UNFILTERED_PARTITION_COUNT,
76 len(list(pilot.app.screen.query("ListItem").results())),
77 )
78

Callers

nothing calls this directly

Calls 9

DeviceInfoClass · 0.90
RecoverpyAppClass · 0.90
assert_with_timeoutFunction · 0.90
get_block_content_textFunction · 0.90
add_expected_save_resultFunction · 0.90
get_expected_save_resultFunction · 0.90

Tested by

no test coverage detected