diff options
author | Gavin Mak <gavinmak@google.com> | 2023-03-11 06:46:20 +0000 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-03-22 17:46:28 +0000 |
commit | ea2e330e43c182dc16b0111ebc69ee5a71ee4ce1 (patch) | |
tree | dc33ba0e56825b3e007d0589891756724725a465 /tests/test_subcmds_init.py | |
parent | 1604cf255f8c1786a23388db6d5277ac7949a24a (diff) | |
download | git-repo-ea2e330e43c182dc16b0111ebc69ee5a71ee4ce1.tar.gz |
Format codebase with black and check formatting in CQ
Apply rules set by https://gerrit-review.googlesource.com/c/git-repo/+/362954/ across the codebase and fix any lingering errors caught
by flake8. Also check black formatting in run_tests (and CQ).
Bug: b/267675342
Change-Id: I972d77649dac351150dcfeb1cd1ad0ea2efc1956
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/363474
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'tests/test_subcmds_init.py')
-rw-r--r-- | tests/test_subcmds_init.py | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/tests/test_subcmds_init.py b/tests/test_subcmds_init.py index af4346de..25e5be56 100644 --- a/tests/test_subcmds_init.py +++ b/tests/test_subcmds_init.py | |||
@@ -20,30 +20,27 @@ from subcmds import init | |||
20 | 20 | ||
21 | 21 | ||
22 | class InitCommand(unittest.TestCase): | 22 | class InitCommand(unittest.TestCase): |
23 | """Check registered all_commands.""" | 23 | """Check registered all_commands.""" |
24 | 24 | ||
25 | def setUp(self): | 25 | def setUp(self): |
26 | self.cmd = init.Init() | 26 | self.cmd = init.Init() |
27 | 27 | ||
28 | def test_cli_parser_good(self): | 28 | def test_cli_parser_good(self): |
29 | """Check valid command line options.""" | 29 | """Check valid command line options.""" |
30 | ARGV = ( | 30 | ARGV = ([],) |
31 | [], | 31 | for argv in ARGV: |
32 | ) | 32 | opts, args = self.cmd.OptionParser.parse_args(argv) |
33 | for argv in ARGV: | 33 | self.cmd.ValidateOptions(opts, args) |
34 | opts, args = self.cmd.OptionParser.parse_args(argv) | 34 | |
35 | self.cmd.ValidateOptions(opts, args) | 35 | def test_cli_parser_bad(self): |
36 | 36 | """Check invalid command line options.""" | |
37 | def test_cli_parser_bad(self): | 37 | ARGV = ( |
38 | """Check invalid command line options.""" | 38 | # Too many arguments. |
39 | ARGV = ( | 39 | ["url", "asdf"], |
40 | # Too many arguments. | 40 | # Conflicting options. |
41 | ['url', 'asdf'], | 41 | ["--mirror", "--archive"], |
42 | 42 | ) | |
43 | # Conflicting options. | 43 | for argv in ARGV: |
44 | ['--mirror', '--archive'], | 44 | opts, args = self.cmd.OptionParser.parse_args(argv) |
45 | ) | 45 | with self.assertRaises(SystemExit): |
46 | for argv in ARGV: | 46 | self.cmd.ValidateOptions(opts, args) |
47 | opts, args = self.cmd.OptionParser.parse_args(argv) | ||
48 | with self.assertRaises(SystemExit): | ||
49 | self.cmd.ValidateOptions(opts, args) | ||