MCPcopy
hub / github.com/scrapy/scrapy / test_command_not_found

Method test_command_not_found

tests/test_commands.py:328–344  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

326 assert call("list", cwd=subdir) == 0
327
328 def test_command_not_found(self) -> None:
329 na_msg = """
330The list command is not available from this location.
331These commands are only available from within a project: check, crawl, edit, list, parse.
332"""
333 not_found_msg = """
334Unknown command: abc
335"""
336 params = [
337 ("list", False, na_msg),
338 ("abc", False, not_found_msg),
339 ("abc", True, not_found_msg),
340 ]
341 for cmdname, inproject, message in params:
342 with mock.patch("sys.stdout", new=StringIO()) as out:
343 _print_unknown_command_msg(Settings(), cmdname, inproject)
344 assert out.getvalue().strip() == message.strip()
345
346
347class TestBenchCommand:

Callers

nothing calls this directly

Calls 2

SettingsClass · 0.90

Tested by

no test coverage detected