File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -272,14 +272,14 @@ def _get_dependencies_list(
272272 raise InvalidArgumentsError (
273273 "Cannot show progress bar because `rich` and `click` dependencies are not installed. "
274274 "It is only meant to be shown when running `twyn` as a cli tool. "
275- "If this is you case, install all the dependencies with `pip install twyn[cli]`. "
275+ "If this is your case, install all the dependencies with `pip install twyn[cli]`. "
276276 ) from e
277277
278278
279279def _get_selector_method (selector_method : str ) -> SelectorMethod :
280280 """Return the selector_method from set of available ones."""
281281 if selector_method not in SELECTOR_METHOD_MAPPING :
282- InvalidSelectorMethodError ("Invalid selector method" )
282+ raise InvalidSelectorMethodError ("Invalid selector method" )
283283
284284 return SELECTOR_METHOD_MAPPING [selector_method ]()
285285
Original file line number Diff line number Diff line change @@ -163,6 +163,11 @@ def test_check_dependencies_detects_typosquats_from_file(
163163 ]
164164 )
165165
166+ def test_check_dependencies_fails_if_unkown_selector_method (self ) -> None :
167+ """Check that if an invalid selector method is given, it raises InvalidSelectorMethodError."""
168+ with pytest .raises (InvalidSelectorMethodError ):
169+ check_dependencies (selector_method = "asfd" )
170+
166171 @patch ("twyn.trusted_packages.TopPyPiReference.get_packages" )
167172 def test_check_dependencies_detects_typosquats_from_file_and_language_is_set (
168173 self , mock_get_packages : Mock , uv_lock_file_with_typo : Path
You can’t perform that action at this time.
0 commit comments