diff options
author | Tom Rini <trini@konsulko.com> | 2025-05-27 07:43:04 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-05-27 07:43:04 -0600 |
commit | 6015a24a5a2647ab044333ed8e2462f90f855e36 (patch) | |
tree | 53fe80bee534a17f6c40e697cc112287a0b4b3c5 /tools/binman/bintool_test.py | |
parent | 39b815d02d7ce6af32bcf023d20243c404b75a84 (diff) | |
parent | ec2482a24ac3a1d0beadae80bcb28c8d89b4c1ab (diff) |
Merge tag 'dm-next-27may25' of git://git.denx.de/u-boot-dm into next
Sync up Python tools from my tree
- minor binman tweaks
- terminal improvements in u_boot_pylib
- patman move to asyncio
- patman support for new 'series' subcommand
Diffstat (limited to 'tools/binman/bintool_test.py')
-rw-r--r-- | tools/binman/bintool_test.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/binman/bintool_test.py b/tools/binman/bintool_test.py index 949d6f4c8a9..7e8dafea94e 100644 --- a/tools/binman/bintool_test.py +++ b/tools/binman/bintool_test.py @@ -55,14 +55,14 @@ class TestBintool(unittest.TestCase): def test_version(self): """Check handling of a tool being present or absent""" btest = Bintool.create('_testing') - with test_util.capture_sys_output() as (stdout, _): + with terminal.capture() as (stdout, _): btest.show() self.assertFalse(btest.is_present()) self.assertIn('-', stdout.getvalue()) btest.present = True self.assertTrue(btest.is_present()) self.assertEqual('123', btest.version()) - with test_util.capture_sys_output() as (stdout, _): + with terminal.capture() as (stdout, _): btest.show() self.assertIn('123', stdout.getvalue()) @@ -90,7 +90,7 @@ class TestBintool(unittest.TestCase): col = terminal.Color() with unittest.mock.patch.object(tools, 'download', side_effect=fake_download): - with test_util.capture_sys_output() as (stdout, _): + with terminal.capture() as (stdout, _): btest.fetch_tool(method, col, False) return stdout.getvalue() @@ -144,7 +144,7 @@ class TestBintool(unittest.TestCase): with unittest.mock.patch.object(bintool.Bintool, 'tooldir', destdir): with unittest.mock.patch.object(tools, 'download', side_effect=handle_download): - with test_util.capture_sys_output() as (stdout, _): + with terminal.capture() as (stdout, _): Bintool.fetch_tools(bintool.FETCH_ANY, ['_testing'] * 2) self.assertTrue(os.path.exists(dest_fname)) data = tools.read_file(dest_fname) @@ -177,7 +177,7 @@ class TestBintool(unittest.TestCase): self.count = collections.defaultdict(int) with unittest.mock.patch.object(bintool.Bintool, 'fetch_tool', side_effect=fake_fetch): - with test_util.capture_sys_output() as (stdout, _): + with terminal.capture() as (stdout, _): Bintool.fetch_tools(method, ['all']) lines = stdout.getvalue().splitlines() self.assertIn(f'{self.count[bintool.FETCHED]}: ', lines[-2]) @@ -220,7 +220,7 @@ class TestBintool(unittest.TestCase): side_effect=[all_tools]): with unittest.mock.patch.object(bintool.Bintool, 'create', side_effect=self.btools.values()): - with test_util.capture_sys_output() as (stdout, _): + with terminal.capture() as (stdout, _): Bintool.fetch_tools(bintool.FETCH_ANY, ['missing']) lines = stdout.getvalue().splitlines() num_tools = len(self.btools) @@ -255,7 +255,7 @@ class TestBintool(unittest.TestCase): with unittest.mock.patch.object(bintool.Bintool, 'tooldir', self._indir): with unittest.mock.patch.object(tools, 'run', side_effect=fake_run): - with test_util.capture_sys_output() as (stdout, _): + with terminal.capture() as (stdout, _): btest.fetch_tool(bintool.FETCH_BUILD, col, False) fname = os.path.join(self._indir, '_testing') return fname if write_file else self.fname, stdout.getvalue() @@ -278,7 +278,7 @@ class TestBintool(unittest.TestCase): btest.install = True col = terminal.Color() with unittest.mock.patch.object(tools, 'run', return_value=None): - with test_util.capture_sys_output() as _: + with terminal.capture() as _: result = btest.fetch_tool(bintool.FETCH_BIN, col, False) self.assertEqual(bintool.FETCHED, result) @@ -287,7 +287,7 @@ class TestBintool(unittest.TestCase): btest = Bintool.create('_testing') btest.disable = True col = terminal.Color() - with test_util.capture_sys_output() as _: + with terminal.capture() as _: result = btest.fetch_tool(bintool.FETCH_BIN, col, False) self.assertEqual(bintool.FAIL, result) @@ -314,7 +314,7 @@ class TestBintool(unittest.TestCase): with unittest.mock.patch.object(tools, 'run', side_effect=fake_run): with unittest.mock.patch.object(tools, 'download', side_effect=handle_download): - with test_util.capture_sys_output() as _: + with terminal.capture() as _: for name in Bintool.get_tool_list(): btool = Bintool.create(name) for method in range(bintool.FETCH_COUNT): |