File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1
1
import mock
2
2
import dash
3
3
from dash import dcc , html # noqa: F401
4
+ import sys
4
5
5
6
from dash .development .base_component import ComponentRegistry
6
7
@@ -102,3 +103,24 @@ def test_internal(mocker):
102
103
), "Dynamic resource not available in registered path {}" .format (
103
104
app .registered_paths ["dash" ]
104
105
)
106
+
107
+
108
+ def test_collect_and_register_resources (mocker ):
109
+
110
+ app = dash .Dash (
111
+ __name__ , assets_folder = "tests/assets" , assets_ignore = "load_after.+.js"
112
+ )
113
+ with mock .patch ("dash.dash.os.stat" , return_value = StatMock ()):
114
+ with mock .patch ("dash.dash.importlib.import_module" ) as import_mock :
115
+ sys .modules ["dash_html_components" ] = dcc
116
+
117
+ import_mock .return_value = dcc
118
+ app ._collect_and_register_resources (
119
+ [
120
+ {
121
+ "namespace" : "dash_html_components" ,
122
+ "relative_package_path" : "dash_html_components.min.js" ,
123
+ },
124
+ ]
125
+ )
126
+ import_mock .assert_any_call ("dash_html_components" )
You can’t perform that action at this time.
0 commit comments