@@ -31,90 +31,77 @@ def test_cli_no_arguments():
31
31
32
32
33
33
@pytest .mark .parametrize (
34
- "args, env, create_app_calls, app_run_calls, wsgi_server_run_calls " ,
34
+ "args, env, create_app_calls, run_calls " ,
35
35
[
36
36
(
37
37
["--target" , "foo" ],
38
38
{},
39
39
[pretend .call ("foo" , None , "http" )],
40
- [],
41
40
[pretend .call ("0.0.0.0" , 8080 )],
42
41
),
43
42
(
44
43
[],
45
44
{"FUNCTION_TARGET" : "foo" },
46
45
[pretend .call ("foo" , None , "http" )],
47
- [],
48
46
[pretend .call ("0.0.0.0" , 8080 )],
49
47
),
50
48
(
51
49
["--target" , "foo" , "--source" , "/path/to/source.py" ],
52
50
{},
53
51
[pretend .call ("foo" , "/path/to/source.py" , "http" )],
54
- [],
55
52
[pretend .call ("0.0.0.0" , 8080 )],
56
53
),
57
54
(
58
55
[],
59
56
{"FUNCTION_TARGET" : "foo" , "FUNCTION_SOURCE" : "/path/to/source.py" },
60
57
[pretend .call ("foo" , "/path/to/source.py" , "http" )],
61
- [],
62
58
[pretend .call ("0.0.0.0" , 8080 )],
63
59
),
64
60
(
65
61
["--target" , "foo" , "--signature-type" , "event" ],
66
62
{},
67
63
[pretend .call ("foo" , None , "event" )],
68
- [],
69
64
[pretend .call ("0.0.0.0" , 8080 )],
70
65
),
71
66
(
72
67
[],
73
68
{"FUNCTION_TARGET" : "foo" , "FUNCTION_SIGNATURE_TYPE" : "event" },
74
69
[pretend .call ("foo" , None , "event" )],
75
- [],
76
70
[pretend .call ("0.0.0.0" , 8080 )],
77
71
),
78
72
(
79
73
["--target" , "foo" , "--dry-run" ],
80
74
{},
81
75
[pretend .call ("foo" , None , "http" )],
82
76
[],
83
- [],
84
77
),
85
78
(
86
79
[],
87
80
{"FUNCTION_TARGET" : "foo" , "DRY_RUN" : "True" },
88
81
[pretend .call ("foo" , None , "http" )],
89
82
[],
90
- [],
91
83
),
92
84
(
93
85
["--target" , "foo" , "--host" , "127.0.0.1" ],
94
86
{},
95
87
[pretend .call ("foo" , None , "http" )],
96
- [],
97
88
[pretend .call ("127.0.0.1" , 8080 )],
98
89
),
99
90
(
100
91
["--target" , "foo" , "--debug" ],
101
92
{},
102
93
[pretend .call ("foo" , None , "http" )],
103
- [pretend .call ("0.0.0.0" , 8080 , True )],
104
- [],
94
+ [pretend .call ("0.0.0.0" , 8080 )],
105
95
),
106
96
(
107
97
[],
108
98
{"FUNCTION_TARGET" : "foo" , "DEBUG" : "True" },
109
99
[pretend .call ("foo" , None , "http" )],
110
- [pretend .call ("0.0.0.0" , 8080 , True )],
111
- [],
100
+ [pretend .call ("0.0.0.0" , 8080 )],
112
101
),
113
102
],
114
103
)
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 ):
118
105
wsgi_server = pretend .stub (run = pretend .call_recorder (lambda * a , ** kw : None ))
119
106
wsgi_app = pretend .stub (run = pretend .call_recorder (lambda * a , ** kw : None ))
120
107
create_app = pretend .call_recorder (lambda * a , ** kw : wsgi_app )
@@ -127,5 +114,4 @@ def test_cli(
127
114
128
115
assert result .exit_code == 0
129
116
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