MCPcopy Create free account
hub / github.com/datapane/datapane / assert_view

Function assert_view

python-client/tests/client/views/test_views.py:44–55  ·  view source on GitHub ↗
(
    view: t.Union[dp.App, dp.Blocks], expected_attachments: int = None, expected_num_blocks: int = None
)

Source from the content-addressed store, hash-verified

42
43
44def assert_view(
45 view: t.Union[dp.App, dp.Blocks], expected_attachments: int = None, expected_num_blocks: int = None
46) -> t.Tuple[str, t.List[t.BinaryIO]]:
47 state = _view_to_xml_and_files(view)
48 view_xml = state.view_xml
49 attachments = state.store.file_list
50 if expected_attachments:
51 assert len(attachments) == expected_attachments
52 if expected_num_blocks:
53 assert num_blocks(view_xml) == expected_num_blocks
54 assert validate_view_doc(xml_str=view_xml)
55 return (view_xml, attachments)
56
57
58################################################################################

Callers 9

test_demoFunction · 0.85
test_build_md_viewFunction · 0.85
test_gen_view_singleFunction · 0.85
test_gen_view_simpleFunction · 0.85
test_gen_view_primitivesFunction · 0.85
test_gen_view_with_filesFunction · 0.85

Calls 3

validate_view_docFunction · 0.90
_view_to_xml_and_filesFunction · 0.85
num_blocksFunction · 0.85

Tested by

no test coverage detected