diff --git a/swh/loader/core/tests/test_loader.py b/swh/loader/core/tests/test_loader.py --- a/swh/loader/core/tests/test_loader.py +++ b/swh/loader/core/tests/test_loader.py @@ -39,14 +39,14 @@ self.loader.maybe_load_revisions(self.in_revisions) self.loader.maybe_load_releases(self.in_releases) - self.assertEquals(len(self.state('content')), 0) - self.assertEquals( + self.assertEqual(len(self.state('content')), 0) + self.assertEqual( len(self.state('directory')), len(self.in_directories)) - self.assertEquals( + self.assertEqual( len(self.state('revision')), len(self.in_revisions)) - self.assertEquals( + self.assertEqual( len(self.state('release')), len(self.in_releases)) - self.assertEquals(len(self.state('snapshot')), 0) + self.assertEqual(len(self.state('snapshot')), 0) def test_stateless_loader(self): """Stateless loader accumulates in place the sent data as well @@ -58,11 +58,11 @@ self.loader.send_batch_contents(self.in_contents) self.loader.send_snapshot(self.in_snapshot) - self.assertEquals(len(self.state('content')), len(self.in_contents)) - self.assertEquals(len(self.state('directory')), 0) - self.assertEquals(len(self.state('revision')), 0) - self.assertEquals(len(self.state('release')), 0) - self.assertEquals(len(self.state('snapshot')), 1) + self.assertEqual(len(self.state('content')), len(self.in_contents)) + self.assertEqual(len(self.state('directory')), 0) + self.assertEqual(len(self.state('revision')), 0) + self.assertEqual(len(self.state('release')), 0) + self.assertEqual(len(self.state('snapshot')), 1) class LoadTestContent(DummyBaseLoaderTest): diff --git a/swh/loader/core/tests/test_queue.py b/swh/loader/core/tests/test_queue.py --- a/swh/loader/core/tests/test_queue.py +++ b/swh/loader/core/tests/test_queue.py @@ -22,21 +22,21 @@ # pop returns the content and reset the queue actual_elements = queue.pop() - self.assertEquals(actual_elements, elements) - self.assertEquals(queue.pop(), []) + self.assertEqual(actual_elements, elements) + self.assertEqual(queue.pop(), []) # duplicates can be integrated new_elements = [1, 1, 3, 4, 9, 20, 30, 40, 12, 14, 2] actual_threshold = queue.add(new_elements) self.assertTrue(actual_threshold) - self.assertEquals(queue.pop(), new_elements) + self.assertEqual(queue.pop(), new_elements) # reset is destructive too queue.add(new_elements) queue.reset() - self.assertEquals(queue.pop(), []) + self.assertEqual(queue.pop(), []) def to_some_objects(elements, key): @@ -58,9 +58,9 @@ # pop returns the content and reset the queue actual_elements = queue.pop() - self.assertEquals(actual_elements, - [{'id': 1}, {'id': 3}, {'id': 4}, {'id': 9}]) - self.assertEquals(queue.pop(), []) + self.assertEqual(actual_elements, + [{'id': 1}, {'id': 3}, {'id': 4}, {'id': 9}]) + self.assertEqual(queue.pop(), []) new_elements = list(to_some_objects( [1, 3, 4, 9, 20], @@ -73,7 +73,7 @@ queue.add(new_elements) queue.reset() - self.assertEquals(queue.pop(), []) + self.assertEqual(queue.pop(), []) def to_some_complex_objects(elements, key): @@ -102,12 +102,12 @@ # pop returns the content and reset the queue actual_elements = queue.pop() - self.assertEquals(actual_elements, - [{'k': 1, 'length': 10}, - {'k': 2, 'length': 20}, - {'k': 3, 'length': 30}, - {'k': 4, 'length': 100}]) - self.assertEquals(queue.pop(), []) + self.assertEqual(actual_elements, + [{'k': 1, 'length': 10}, + {'k': 2, 'length': 20}, + {'k': 3, 'length': 30}, + {'k': 4, 'length': 100}]) + self.assertEqual(queue.pop(), []) # size threshold not reached, nb elements reached, the # threshold is considered reached @@ -133,4 +133,4 @@ queue.add(new_elements) queue.reset() - self.assertEquals(queue.pop(), []) + self.assertEqual(queue.pop(), [])