Formatting: Format all python code with black.
This CL is probably not what you're looking for, it's only
automated formatting. Ignore it with
`git blame --ignore-rev <revision>` for this commit.
BUG=b:233893248
TEST=CQ
Change-Id: I66591d7a738d241aed3290138c0f68065ab10a6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3879174
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Alex Klein <saklein@chromium.org>
diff --git a/scripts/install_toolchain_unittest.py b/scripts/install_toolchain_unittest.py
index 03c91c8..d503c72 100644
--- a/scripts/install_toolchain_unittest.py
+++ b/scripts/install_toolchain_unittest.py
@@ -14,48 +14,44 @@
class ParseArgsTest(cros_test_lib.TempDirTestCase):
- """Tests for argument parsing and validation rules."""
+ """Tests for argument parsing and validation rules."""
- # pylint: disable=protected-access
- def setUp(self):
- D = cros_test_lib.Directory
- filesystem = (
- D('build', (
- D('board', (
- D('etc', (
- 'make.conf.board_setup',
- )),
- )),
- )),
- )
- cros_test_lib.CreateOnDiskHierarchy(self.tempdir, filesystem)
+ # pylint: disable=protected-access
+ def setUp(self):
+ D = cros_test_lib.Directory
+ filesystem = (
+ D("build", (D("board", (D("etc", ("make.conf.board_setup",)),)),)),
+ )
+ cros_test_lib.CreateOnDiskHierarchy(self.tempdir, filesystem)
- self.chost_value = 'chost'
- osutils.WriteFile(os.path.join(self.tempdir,
- 'build/board/etc/make.conf.board_setup'),
- 'CHOST="%s"' % self.chost_value)
+ self.chost_value = "chost"
+ osutils.WriteFile(
+ os.path.join(self.tempdir, "build/board/etc/make.conf.board_setup"),
+ 'CHOST="%s"' % self.chost_value,
+ )
- self.sysroot_dir = os.path.join(self.tempdir, 'build/board')
- # make.conf needs to exist to correctly read back config.
- unittest_lib.create_stub_make_conf(self.sysroot_dir)
+ self.sysroot_dir = os.path.join(self.tempdir, "build/board")
+ # make.conf needs to exist to correctly read back config.
+ unittest_lib.create_stub_make_conf(self.sysroot_dir)
- def testInvalidArgs(self):
- """Test invalid argument parsing."""
- with self.assertRaises(SystemExit):
- install_toolchain._ParseArgs([])
+ def testInvalidArgs(self):
+ """Test invalid argument parsing."""
+ with self.assertRaises(SystemExit):
+ install_toolchain._ParseArgs([])
- def testSysrootCreate(self):
- """Test the sysroot is correctly built."""
- opts = install_toolchain._ParseArgs(['--sysroot', self.sysroot_dir])
- self.assertIsInstance(opts.sysroot, sysroot_lib.Sysroot)
- self.assertEqual(self.sysroot_dir, opts.sysroot.path)
+ def testSysrootCreate(self):
+ """Test the sysroot is correctly built."""
+ opts = install_toolchain._ParseArgs(["--sysroot", self.sysroot_dir])
+ self.assertIsInstance(opts.sysroot, sysroot_lib.Sysroot)
+ self.assertEqual(self.sysroot_dir, opts.sysroot.path)
- def testToolchain(self):
- """Test toolchain arg precedence/fallback."""
- toolchain = 'toolchain'
- opts = install_toolchain._ParseArgs(['--sysroot', self.sysroot_dir,
- '--toolchain', toolchain])
- self.assertEqual(toolchain, opts.toolchain)
+ def testToolchain(self):
+ """Test toolchain arg precedence/fallback."""
+ toolchain = "toolchain"
+ opts = install_toolchain._ParseArgs(
+ ["--sysroot", self.sysroot_dir, "--toolchain", toolchain]
+ )
+ self.assertEqual(toolchain, opts.toolchain)
- opts = install_toolchain._ParseArgs(['--sysroot', self.sysroot_dir])
- self.assertEqual(self.chost_value, opts.toolchain)
+ opts = install_toolchain._ParseArgs(["--sysroot", self.sysroot_dir])
+ self.assertEqual(self.chost_value, opts.toolchain)