File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,39 @@ def test_check_private(
113
113
assert tester .io .fetch_output () == expected
114
114
115
115
116
+ @pytest .mark .parametrize (
117
+ ("options" , "expected" , "expected_status" ),
118
+ [
119
+ ("" , "All set!\n " , 0 ),
120
+ ("--lock" , "Error: poetry.lock was not found.\n " , 1 ),
121
+ ],
122
+ )
123
+ def test_check_lock_missing (
124
+ mocker : MockerFixture ,
125
+ tester : CommandTester ,
126
+ fixture_dir : FixtureDirGetter ,
127
+ options : str ,
128
+ expected : str ,
129
+ expected_status : int ,
130
+ ) -> None :
131
+ from poetry .toml import TOMLFile
132
+
133
+ mocker .patch (
134
+ "poetry.poetry.Poetry.file" ,
135
+ return_value = TOMLFile (fixture_dir ("private_pyproject" ) / "pyproject.toml" ),
136
+ new_callable = mocker .PropertyMock ,
137
+ )
138
+
139
+ status_code = tester .execute (options )
140
+
141
+ assert status_code == expected_status
142
+
143
+ if status_code == 0 :
144
+ assert tester .io .fetch_output () == expected
145
+ else :
146
+ assert tester .io .fetch_error () == expected
147
+
148
+
116
149
@pytest .mark .parametrize ("options" , ["" , "--lock" ])
117
150
def test_check_lock_outdated (
118
151
command_tester_factory : CommandTesterFactory ,
You can’t perform that action at this time.
0 commit comments