From ea2e330e43c182dc16b0111ebc69ee5a71ee4ce1 Mon Sep 17 00:00:00 2001 From: Gavin Mak Date: Sat, 11 Mar 2023 06:46:20 +0000 Subject: 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 Tested-by: Gavin Mak Commit-Queue: Gavin Mak --- tests/test_subcmds_init.py | 51 ++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'tests/test_subcmds_init.py') 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 class InitCommand(unittest.TestCase): - """Check registered all_commands.""" - - def setUp(self): - self.cmd = init.Init() - - def test_cli_parser_good(self): - """Check valid command line options.""" - ARGV = ( - [], - ) - for argv in ARGV: - opts, args = self.cmd.OptionParser.parse_args(argv) - self.cmd.ValidateOptions(opts, args) - - def test_cli_parser_bad(self): - """Check invalid command line options.""" - ARGV = ( - # Too many arguments. - ['url', 'asdf'], - - # Conflicting options. - ['--mirror', '--archive'], - ) - for argv in ARGV: - opts, args = self.cmd.OptionParser.parse_args(argv) - with self.assertRaises(SystemExit): - self.cmd.ValidateOptions(opts, args) + """Check registered all_commands.""" + + def setUp(self): + self.cmd = init.Init() + + def test_cli_parser_good(self): + """Check valid command line options.""" + ARGV = ([],) + for argv in ARGV: + opts, args = self.cmd.OptionParser.parse_args(argv) + self.cmd.ValidateOptions(opts, args) + + def test_cli_parser_bad(self): + """Check invalid command line options.""" + ARGV = ( + # Too many arguments. + ["url", "asdf"], + # Conflicting options. + ["--mirror", "--archive"], + ) + for argv in ARGV: + opts, args = self.cmd.OptionParser.parse_args(argv) + with self.assertRaises(SystemExit): + self.cmd.ValidateOptions(opts, args) -- cgit v1.2.3-54-g00ecf