From 00c48976f5fa06e8b52187382262fdbeecf52a03 Mon Sep 17 00:00:00 2001 From: Nathaniel Rook Date: Sun, 5 Jan 2025 14:30:18 -0500 Subject: [PATCH] Fix test_replays_to_json --- .../replays/test_replays_to_json.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/project/thscoreboard/replays/test_replays_to_json.py b/project/thscoreboard/replays/test_replays_to_json.py index b39e07b2..9cf13509 100644 --- a/project/thscoreboard/replays/test_replays_to_json.py +++ b/project/thscoreboard/replays/test_replays_to_json.py @@ -95,13 +95,14 @@ def testConvertReplaysToJsonString(self): def testMedalEmojisSingleShot(self): for i in range(5): + user = self.createUser(f"user{i}") with patch( "replays.constant_helpers.CalculateReplayFileHash" ) as mocked_hash: mocked_hash.return_value = bytes(i) test_replays.CreateAsPublishedReplay( "th10_normal", - user=self.user, + user=user, score=1_000_000_000 - 100_000_000 * i, difficulty=0, ) @@ -111,11 +112,11 @@ def testMedalEmojisSingleShot(self): converter = ReplayToJsonConverter() json_data = [converter.convert_replay_to_dict(replay) for replay in replays] - self.assertEquals(json_data[0]["Score"]["text"], "🥇1,000,000,000") - self.assertEquals(json_data[1]["Score"]["text"], "🥈900,000,000") - self.assertEquals(json_data[2]["Score"]["text"], "🥉800,000,000") - self.assertEquals(json_data[3]["Score"]["text"], "700,000,000") - self.assertEquals(json_data[4]["Score"]["text"], "600,000,000") + self.assertEqual(json_data[0]["Score"]["text"], "🥇1,000,000,000") + self.assertEqual(json_data[1]["Score"]["text"], "🥈900,000,000") + self.assertEqual(json_data[2]["Score"]["text"], "🥉800,000,000") + self.assertEqual(json_data[3]["Score"]["text"], "700,000,000") + self.assertEqual(json_data[4]["Score"]["text"], "600,000,000") def testMedalEmojisMultipleShots(self): replay_filenames = [ @@ -136,5 +137,5 @@ def testMedalEmojisMultipleShots(self): converter = ReplayToJsonConverter() json_data = [converter.convert_replay_to_dict(replay) for replay in replays] - self.assertEquals(json_data[0]["Score"]["text"], "🥇1,000,000,000") - self.assertEquals(json_data[1]["Score"]["text"], "🥇900,000,000") + self.assertEqual(json_data[0]["Score"]["text"], "🥇1,000,000,000") + self.assertEqual(json_data[1]["Score"]["text"], "🥇900,000,000")