MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / _setup_project

Function _setup_project

tests/integration/test_dataset_transforms.py:42–69  ·  view source on GitHub ↗

Build a ProjectFile-mode project with `dataset_count` plot datasets and the given parser installed.

(
    api_client,
    parser_code: str,
    parser_language: int,
    dataset_count: int = 1,
)

Source from the content-addressed store, hash-verified

40
41
42def _setup_project(
43 api_client,
44 parser_code: str,
45 parser_language: int,
46 dataset_count: int = 1,
47) -> None:
48 """
49 Build a ProjectFile-mode project with `dataset_count` plot datasets and
50 the given parser installed.
51 """
52 api_client.create_new_project()
53 time.sleep(0.2)
54
55 gid = api_client.add_group("G", widget_type=0)
56 for _ in range(dataset_count):
57 api_client.add_dataset(gid, options=1)
58
59 api_client.set_operation_mode("project")
60 api_client.configure_frame_parser(
61 start_sequence="/*",
62 end_sequence="*/",
63 checksum_algorithm="",
64 frame_detection=1,
65 operation_mode=0,
66 )
67
68 api_client.set_frame_parser_code(parser_code, language=parser_language, source_id=0)
69 time.sleep(0.15)
70
71
72def _set_transform(api_client, group_id: int, dataset_id: int, code: str) -> None:

Calls 6

create_new_projectMethod · 0.80
add_groupMethod · 0.80
add_datasetMethod · 0.80
set_operation_modeMethod · 0.80
set_frame_parser_codeMethod · 0.80

Tested by

no test coverage detected