tools: binman: fix deprecated Python unittest methods
The methods `unittest.assertEquals()` and `unittest.assertRegexpMatches()` are marked deprecated[1]. In Python 3.12 these aliases have been removed, so do a sed to replace them with their new names. [1] https://docs.python.org/3.11/library/unittest.html#deprecated-aliases Signed-off-by: Brandon Maier <brandon.maier@collins.com> CC: Simon Glass <sjg@chromium.org> CC: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:

committed by
Simon Glass

parent
a8729a260b
commit
357bfca5e6
@@ -103,7 +103,7 @@ class TestEntry(unittest.TestCase):
|
||||
ent = entry.Entry.Create(None, self.GetNode(), 'missing',
|
||||
missing_etype=True)
|
||||
self.assertTrue(isinstance(ent, Entry_blob))
|
||||
self.assertEquals('missing', ent.etype)
|
||||
self.assertEqual('missing', ent.etype)
|
||||
|
||||
def testDecompressData(self):
|
||||
"""Test the DecompressData() method of the base class"""
|
||||
@@ -111,8 +111,8 @@ class TestEntry(unittest.TestCase):
|
||||
base.compress = 'lz4'
|
||||
bintools = {}
|
||||
base.comp_bintool = base.AddBintool(bintools, '_testing')
|
||||
self.assertEquals(tools.get_bytes(0, 1024), base.CompressData(b'abc'))
|
||||
self.assertEquals(tools.get_bytes(0, 1024), base.DecompressData(b'abc'))
|
||||
self.assertEqual(tools.get_bytes(0, 1024), base.CompressData(b'abc'))
|
||||
self.assertEqual(tools.get_bytes(0, 1024), base.DecompressData(b'abc'))
|
||||
|
||||
def testLookupOffset(self):
|
||||
"""Test the lookup_offset() method of the base class"""
|
||||
|
Reference in New Issue
Block a user