@@ -41,6 +41,40 @@ def test_dev() -> None:
4141 in result .output
4242 )
4343
44+ assert "🐍 single_file_app.py" in result .output
45+
46+
47+ def test_dev_package () -> None :
48+ with changing_dir (assets_path ):
49+ with patch .object (uvicorn , "run" ) as mock_run :
50+ result = runner .invoke (app , ["dev" , "nested_package/package" ])
51+ assert result .exit_code == 0 , result .output
52+ assert mock_run .called
53+ assert mock_run .call_args
54+ assert mock_run .call_args .kwargs == {
55+ "app" : "nested_package.package:app" ,
56+ "host" : "127.0.0.1" ,
57+ "port" : 8000 ,
58+ "reload" : True ,
59+ "workers" : None ,
60+ "root_path" : "" ,
61+ "proxy_headers" : True ,
62+ "log_config" : get_uvicorn_log_config (),
63+ }
64+ assert "Using import string: nested_package.package:app" in result .output
65+ assert "Starting development server 🚀" in result .output
66+ assert "Server started at https://127.0.0.1:8000" in result .output
67+ assert "Documentation at https://127.0.0.1:8000/docs" in result .output
68+ assert (
69+ "Running in development mode, for production use: fastapi run"
70+ in result .output
71+ )
72+
73+ assert "📁 package" in result .output
74+ assert "└── 🐍 __init__.py" in result .output
75+ assert "└── 📁 package" in result .output
76+ assert " └── 🐍 __init__.py" in result .output
77+
4478
4579def test_dev_args () -> None :
4680 with changing_dir (assets_path ):
0 commit comments