MCPcopy Index your code
hub / github.com/plotly/dash / test_collect_and_register_resources

Function test_collect_and_register_resources

tests/unit/test_resources.py:107–124  ·  view source on GitHub ↗
(mocker)

Source from the content-addressed store, hash-verified

105
106
107def 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
127def test_resources_with_attributes():

Callers

nothing calls this directly

Calls 2

StatMockClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…