(mocker)
| 105 | |
| 106 | |
| 107 | def test_collect_and_register_resources(mocker): |
| 108 | |
| 109 | app = dash.Dash( |
| 110 | __name__, assets_folder="tests/assets", assets_ignore="load_after.+.js" |
| 111 | ) |
| 112 | with mock.patch("dash.dash.os.stat", return_value=StatMock()): |
| 113 | with mock.patch("dash.dash.importlib.import_module") as import_mock: |
| 114 | with mock.patch("sys.modules", {"dash_html_components": dcc}): |
| 115 | import_mock.return_value = dcc |
| 116 | app._collect_and_register_resources( |
| 117 | [ |
| 118 | { |
| 119 | "namespace": "dash_html_components", |
| 120 | "relative_package_path": "dash_html_components.min.js", |
| 121 | }, |
| 122 | ] |
| 123 | ) |
| 124 | import_mock.assert_any_call("dash_html_components") |
| 125 | |
| 126 | |
| 127 | def test_resources_with_attributes(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…