summaryrefslogtreecommitdiff
path: root/tools/binman/bintool_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/binman/bintool_test.py')
-rw-r--r--tools/binman/bintool_test.py20
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):