patman: Convert camel case in tools.py
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -27,7 +27,7 @@ class FakeEntry:
|
||||
"""
|
||||
def __init__(self, contents_size):
|
||||
self.contents_size = contents_size
|
||||
self.data = tools.GetBytes(ord('a'), contents_size)
|
||||
self.data = tools.get_bytes(ord('a'), contents_size)
|
||||
|
||||
def GetPath(self):
|
||||
return 'entry_path'
|
||||
@@ -72,7 +72,7 @@ def BuildElfTestFiles(target_dir):
|
||||
if 'MAKEFLAGS' in os.environ:
|
||||
del os.environ['MAKEFLAGS']
|
||||
try:
|
||||
tools.Run('make', '-C', target_dir, '-f',
|
||||
tools.run('make', '-C', target_dir, '-f',
|
||||
os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir)
|
||||
except ValueError as e:
|
||||
# The test system seems to suppress this in a strange way
|
||||
@@ -83,7 +83,7 @@ class TestElf(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls._indir = tempfile.mkdtemp(prefix='elf.')
|
||||
tools.SetInputDirs(['.'])
|
||||
tools.set_input_dirs(['.'])
|
||||
BuildElfTestFiles(cls._indir)
|
||||
|
||||
@classmethod
|
||||
@@ -166,7 +166,7 @@ class TestElf(unittest.TestCase):
|
||||
section = FakeSection(sym_value=None)
|
||||
elf_fname = self.ElfTestFile('u_boot_binman_syms')
|
||||
syms = elf.LookupAndWriteSymbols(elf_fname, entry, section)
|
||||
self.assertEqual(tools.GetBytes(255, 20) + tools.GetBytes(ord('a'), 4),
|
||||
self.assertEqual(tools.get_bytes(255, 20) + tools.get_bytes(ord('a'), 4),
|
||||
entry.data)
|
||||
|
||||
def testDebug(self):
|
||||
@@ -193,7 +193,7 @@ class TestElf(unittest.TestCase):
|
||||
# Make an Elf file and then convert it to a fkat binary file. This
|
||||
# should produce the original data.
|
||||
elf.MakeElf(elf_fname, expected_text, expected_data)
|
||||
objcopy, args = tools.GetTargetCompileTool('objcopy')
|
||||
objcopy, args = tools.get_target_compile_tool('objcopy')
|
||||
args += ['-O', 'binary', elf_fname, bin_fname]
|
||||
stdout = command.Output(objcopy, *args)
|
||||
with open(bin_fname, 'rb') as fd:
|
||||
@@ -210,7 +210,7 @@ class TestElf(unittest.TestCase):
|
||||
expected_data = b'wxyz'
|
||||
elf_fname = os.path.join(outdir, 'elf')
|
||||
elf.MakeElf(elf_fname, expected_text, expected_data)
|
||||
data = tools.ReadFile(elf_fname)
|
||||
data = tools.read_file(elf_fname)
|
||||
|
||||
load = 0xfef20000
|
||||
entry = load + 2
|
||||
@@ -231,7 +231,7 @@ class TestElf(unittest.TestCase):
|
||||
offset = elf.GetSymbolFileOffset(fname, ['embed_start', 'embed_end'])
|
||||
start = offset['embed_start'].offset
|
||||
end = offset['embed_end'].offset
|
||||
data = tools.ReadFile(fname)
|
||||
data = tools.read_file(fname)
|
||||
embed_data = data[start:end]
|
||||
expect = struct.pack('<III', 0x1234, 0x5678, 0)
|
||||
self.assertEqual(expect, embed_data)
|
||||
|
Reference in New Issue
Block a user