Skip to content
Snippets Groups Projects
Commit bacf6a91 authored by Lorenzo  ZOLFANELLI's avatar Lorenzo ZOLFANELLI
Browse files

test: fix wrong assertEquals calls

parent aecc3b9e
No related branches found
No related tags found
No related merge requests found
......@@ -134,7 +134,7 @@ class TestCommon(unittest.TestCase):
# The chunk metadata is always 16 bytes long
chunk_metadata = real_data.read(16)
header, relative_offset, data_length = struct.unpack("IIQ", chunk_metadata)
self.assertEquals(header, 0xabeceda)
self.assertEqual(header, 0xabeceda)
# We start at the location of the chunk metadata, skip over the metadata, and then proceed to the
# start of the actual data field, which is at some arbitrary place after the metadata.
......@@ -152,4 +152,4 @@ class TestCommon(unittest.TestCase):
with self.assertRaises(ValueError) as context:
read_chunk(fh, chunk_location + 1)
self.assertEquals(str(context.exception), "The ND2 file seems to be corrupted.")
self.assertEqual(str(context.exception), "The ND2 file seems to be corrupted.")
......@@ -15,7 +15,7 @@ class TestLegacy(unittest.TestCase):
with Nd2('test_data/legacy.nd2') as reader:
self.assertIsInstance(reader.reader, ND2Reader)
self.assertTrue(issubclass(w[0].category, DeprecationWarning))
self.assertEquals(str(w[0].message), "The 'Nd2' class is deprecated, please consider using the new" +
self.assertEqual(str(w[0].message), "The 'Nd2' class is deprecated, please consider using the new" +
" ND2Reader interface which uses pims.")
def test_misc(self):
......@@ -30,9 +30,9 @@ class TestLegacy(unittest.TestCase):
"Fields of View: %s" % len(reader.fields_of_view),
"Z-Levels: %s" % len(reader.z_levels)
])
self.assertEquals(representation, str(reader))
self.assertEqual(representation, str(reader))
# not implemented yet
self.assertEquals(reader.pixel_microns, None)
self.assertEqual(reader.pixel_microns, None)
self.assertEquals(len(reader), 1)
self.assertEqual(len(reader), 1)
......@@ -77,4 +77,4 @@ class TestRawMetadata(unittest.TestCase):
def test_color_channels(self):
parsed_channels = self.metadata.get_parsed_metadata()['channels']
self.assertEquals(parsed_channels, ['TRITC'])
self.assertEqual(parsed_channels, ['TRITC'])
......@@ -54,7 +54,7 @@ class TestReader(unittest.TestCase):
with ArtificialND2('test_data/test_nd2_reader.nd2') as _:
with ND2Reader('test_data/test_nd2_reader.nd2') as reader:
timesteps = reader.timesteps
self.assertEquals(len(timesteps), 0)
self.assertEqual(len(timesteps), 0)
def test_get_frame_zero(self):
# Best test we can do for now:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment