@@ -31,90 +31,77 @@ def test_cli_no_arguments():
3131
3232
3333@pytest .mark .parametrize (
34- "args, env, create_app_calls, app_run_calls, wsgi_server_run_calls " ,
34+ "args, env, create_app_calls, run_calls " ,
3535 [
3636 (
3737 ["--target" , "foo" ],
3838 {},
3939 [pretend .call ("foo" , None , "http" )],
40- [],
4140 [pretend .call ("0.0.0.0" , 8080 )],
4241 ),
4342 (
4443 [],
4544 {"FUNCTION_TARGET" : "foo" },
4645 [pretend .call ("foo" , None , "http" )],
47- [],
4846 [pretend .call ("0.0.0.0" , 8080 )],
4947 ),
5048 (
5149 ["--target" , "foo" , "--source" , "/path/to/source.py" ],
5250 {},
5351 [pretend .call ("foo" , "/path/to/source.py" , "http" )],
54- [],
5552 [pretend .call ("0.0.0.0" , 8080 )],
5653 ),
5754 (
5855 [],
5956 {"FUNCTION_TARGET" : "foo" , "FUNCTION_SOURCE" : "/path/to/source.py" },
6057 [pretend .call ("foo" , "/path/to/source.py" , "http" )],
61- [],
6258 [pretend .call ("0.0.0.0" , 8080 )],
6359 ),
6460 (
6561 ["--target" , "foo" , "--signature-type" , "event" ],
6662 {},
6763 [pretend .call ("foo" , None , "event" )],
68- [],
6964 [pretend .call ("0.0.0.0" , 8080 )],
7065 ),
7166 (
7267 [],
7368 {"FUNCTION_TARGET" : "foo" , "FUNCTION_SIGNATURE_TYPE" : "event" },
7469 [pretend .call ("foo" , None , "event" )],
75- [],
7670 [pretend .call ("0.0.0.0" , 8080 )],
7771 ),
7872 (
7973 ["--target" , "foo" , "--dry-run" ],
8074 {},
8175 [pretend .call ("foo" , None , "http" )],
8276 [],
83- [],
8477 ),
8578 (
8679 [],
8780 {"FUNCTION_TARGET" : "foo" , "DRY_RUN" : "True" },
8881 [pretend .call ("foo" , None , "http" )],
8982 [],
90- [],
9183 ),
9284 (
9385 ["--target" , "foo" , "--host" , "127.0.0.1" ],
9486 {},
9587 [pretend .call ("foo" , None , "http" )],
96- [],
9788 [pretend .call ("127.0.0.1" , 8080 )],
9889 ),
9990 (
10091 ["--target" , "foo" , "--debug" ],
10192 {},
10293 [pretend .call ("foo" , None , "http" )],
103- [pretend .call ("0.0.0.0" , 8080 , True )],
104- [],
94+ [pretend .call ("0.0.0.0" , 8080 )],
10595 ),
10696 (
10797 [],
10898 {"FUNCTION_TARGET" : "foo" , "DEBUG" : "True" },
10999 [pretend .call ("foo" , None , "http" )],
110- [pretend .call ("0.0.0.0" , 8080 , True )],
111- [],
100+ [pretend .call ("0.0.0.0" , 8080 )],
112101 ),
113102 ],
114103)
115- def test_cli (
116- monkeypatch , args , env , create_app_calls , app_run_calls , wsgi_server_run_calls ,
117- ):
104+ def test_cli (monkeypatch , args , env , create_app_calls , run_calls ):
118105 wsgi_server = pretend .stub (run = pretend .call_recorder (lambda * a , ** kw : None ))
119106 wsgi_app = pretend .stub (run = pretend .call_recorder (lambda * a , ** kw : None ))
120107 create_app = pretend .call_recorder (lambda * a , ** kw : wsgi_app )
@@ -127,5 +114,4 @@ def test_cli(
127114
128115 assert result .exit_code == 0
129116 assert create_app .calls == create_app_calls
130- assert wsgi_app .run .calls == app_run_calls
131- assert wsgi_server .run .calls == wsgi_server_run_calls
117+ assert wsgi_server .run .calls == run_calls
0 commit comments