Skip to content

Commit

Permalink
tests that all CLI help messages don't throw errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpdev committed Apr 17, 2022
1 parent 7c0f3b5 commit 4129494
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_commands.py
Expand Up @@ -915,3 +915,17 @@ def start_requests(self):
args = ['-o', 'example1.json', '-O', 'example2.json']
log = self.get_log(spider_code, args=args)
self.assertIn("error: Please use only one of -o/--output and -O/--overwrite-output", log)


class HelpMessageTest(CommandTest):

def setUp(self):
super().setUp()
self.commands = ["parse", "startproject", "view", "crawl", "edit",
"list", "fetch", "settings", "shell", "runspider",
"version", "genspider", "check", "bench"]

def test_help_messages(self):
for command in self.commands:
_, out, _ = self.proc(command, "-h")
self.assertIn("Usage", out)

0 comments on commit 4129494

Please sign in to comment.