File tree 2 files changed +33
-0
lines changed
dagster-components/dagster_components_tests/code_locations
dagster-dg/dagster_dg_tests/cli_tests
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ import importlib
2
+ import sys
3
+ import warnings
4
+ from pathlib import Path
5
+
6
+
7
+ def test_load_component_defs_with_extraneous_files_in_components_dir ():
8
+ # import the module
9
+ # ensure module is added to path
10
+ # capture warnings
11
+ with warnings .catch_warnings (record = True ) as w :
12
+ sys .path .append (str (Path (__file__ ).parent / "extraneous_files_in_components_dir" ))
13
+ module = importlib .import_module ("extraneous_files_in_components_dir.definitions" )
14
+ assert module is not None
15
+ assert len (w ) == 1
16
+ assert (
17
+ str (w [0 ].message )
18
+ == "Found 1 Python files in the components root. Components expect all Python files to be nested in component subdirectories."
19
+ )
Original file line number Diff line number Diff line change @@ -112,6 +112,20 @@ def test_component_type_docs_success():
112
112
assert_runner_result (result )
113
113
114
114
115
+ def test_component_type_docs_success_output_console ():
116
+ with ProxyRunner .test () as runner , isolated_components_venv (runner ):
117
+ result = runner .invoke (
118
+ "component-type" ,
119
+ "docs" ,
120
+ "complex_schema_asset@dagster_components.test" ,
121
+ "--output" ,
122
+ "cli" ,
123
+ )
124
+ assert_runner_result (result )
125
+ assert "<html" in result .output
126
+ assert "An asset that has a complex params schema." in result .output
127
+
128
+
115
129
def test_component_type_docs_with_no_dagster_components_fails () -> None :
116
130
with (
117
131
ProxyRunner .test () as runner ,
You can’t perform that action at this time.
0 commit comments