binman: Move the tools directory into the Bintool class
We want to be able to change this directory. Use a class member to hold
the value, since changing a constant is not good.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/bintool_test.py b/tools/binman/bintool_test.py
index 7efb839..57e866e 100644
--- a/tools/binman/bintool_test.py
+++ b/tools/binman/bintool_test.py
@@ -139,7 +139,7 @@
dest_fname = os.path.join(destdir, '_testing')
self.seq = 0
- with unittest.mock.patch.object(bintool, 'DOWNLOAD_DESTDIR', destdir):
+ 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, _):
@@ -250,7 +250,7 @@
btest = Bintool.create('_testing')
col = terminal.Color()
self.fname = None
- with unittest.mock.patch.object(bintool, 'DOWNLOAD_DESTDIR',
+ 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, _):