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/dep_tracker_unittest.py b/scripts/dep_tracker_unittest.py
index 05a2256..71bb6b7 100644
--- a/scripts/dep_tracker_unittest.py
+++ b/scripts/dep_tracker_unittest.py
@@ -20,53 +20,61 @@
class MainTest(cros_test_lib.OutputTestCase):
- """Tests for the main() function."""
+ """Tests for the main() function."""
- def testHelp(self):
- """Test that --help is functioning."""
- argv = ['--help']
+ def testHelp(self):
+ """Test that --help is functioning."""
+ argv = ["--help"]
- with self.OutputCapturer() as output:
- # Running with --help should exit with code==0.
- self.AssertFuncSystemExitZero(dep_tracker.main, argv)
+ with self.OutputCapturer() as output:
+ # Running with --help should exit with code==0.
+ self.AssertFuncSystemExitZero(dep_tracker.main, argv)
- # Verify that a message beginning with "usage: " was printed.
- stdout = output.GetStdout()
- self.assertTrue(stdout.startswith('usage: '))
+ # Verify that a message beginning with "usage: " was printed.
+ stdout = output.GetStdout()
+ self.assertTrue(stdout.startswith("usage: "))
class DepTrackerTest(cros_test_lib.TempDirTestCase):
- """Tests for the DepTracker() class."""
+ """Tests for the DepTracker() class."""
- def testSimpleDep(self):
- unittest_lib.BuildELF(os.path.join(self.tempdir, 'libabc.so'),
- ['func_a', 'func_b', 'func_c'])
- unittest_lib.BuildELF(os.path.join(self.tempdir, 'abc_main'),
- undefined_symbols=['func_b'],
- used_libs=['abc'],
- executable=True)
- dt = dep_tracker.DepTracker(self.tempdir)
- dt.Init()
- dt.ComputeELFFileDeps()
+ def testSimpleDep(self):
+ unittest_lib.BuildELF(
+ os.path.join(self.tempdir, "libabc.so"),
+ ["func_a", "func_b", "func_c"],
+ )
+ unittest_lib.BuildELF(
+ os.path.join(self.tempdir, "abc_main"),
+ undefined_symbols=["func_b"],
+ used_libs=["abc"],
+ executable=True,
+ )
+ dt = dep_tracker.DepTracker(self.tempdir)
+ dt.Init()
+ dt.ComputeELFFileDeps()
- self.assertEqual(sorted(dt._files.keys()), ['abc_main', 'libabc.so'])
+ self.assertEqual(sorted(dt._files.keys()), ["abc_main", "libabc.so"])
- def testFiletypeSet(self):
- """Tests that the 'ftype' member is set for ELF files first."""
- unittest_lib.BuildELF(os.path.join(self.tempdir, 'libabc.so'),
- ['func_a', 'func_b', 'func_c'])
- osutils.WriteFile(os.path.join(self.tempdir, 'pyscript'),
- '#!/usr/bin/python\nimport sys\nsys.exit(42)\n')
- dt = dep_tracker.DepTracker(self.tempdir)
- dt.Init()
+ def testFiletypeSet(self):
+ """Tests that the 'ftype' member is set for ELF files first."""
+ unittest_lib.BuildELF(
+ os.path.join(self.tempdir, "libabc.so"),
+ ["func_a", "func_b", "func_c"],
+ )
+ osutils.WriteFile(
+ os.path.join(self.tempdir, "pyscript"),
+ "#!/usr/bin/python\nimport sys\nsys.exit(42)\n",
+ )
+ dt = dep_tracker.DepTracker(self.tempdir)
+ dt.Init()
- # ComputeELFFileDeps() should compute the file type of ELF files so we
- # don't need to parse them again.
- dt.ComputeELFFileDeps()
- self.assertTrue('ftype' in dt._files['libabc.so'])
- self.assertFalse('ftype' in dt._files['pyscript'])
+ # ComputeELFFileDeps() should compute the file type of ELF files so we
+ # don't need to parse them again.
+ dt.ComputeELFFileDeps()
+ self.assertTrue("ftype" in dt._files["libabc.so"])
+ self.assertFalse("ftype" in dt._files["pyscript"])
- # ComputeFileTypes() shold compute the file type of every file.
- dt.ComputeFileTypes()
- self.assertTrue('ftype' in dt._files['libabc.so'])
- self.assertTrue('ftype' in dt._files['pyscript'])
+ # ComputeFileTypes() shold compute the file type of every file.
+ dt.ComputeFileTypes()
+ self.assertTrue("ftype" in dt._files["libabc.so"])
+ self.assertTrue("ftype" in dt._files["pyscript"])