diff --git a/tests/test_cloud_sync_progress.py b/tests/test_cloud_sync_progress.py index eac211769..94601113e 100644 --- a/tests/test_cloud_sync_progress.py +++ b/tests/test_cloud_sync_progress.py @@ -111,7 +111,7 @@ class TestCloudSyncProgressDialogInit(unittest.TestCase): def _make_dialog(self, direction="pre-launch"): game = _make_game() sync_func = MagicMock(return_value=[]) - dialog = object.__new__(CloudSyncProgressDialog) + dialog = CloudSyncProgressDialog.__new__(CloudSyncProgressDialog) dialog.game = game dialog._sync_func = sync_func dialog._direction = direction @@ -140,7 +140,7 @@ class TestCloudSyncProgressDialogRunSync(unittest.TestCase): def _make_dialog(self): game = _make_game() sync_func = MagicMock(return_value=[]) - dialog = object.__new__(CloudSyncProgressDialog) + dialog = CloudSyncProgressDialog.__new__(CloudSyncProgressDialog) dialog.game = game dialog._sync_func = sync_func dialog._direction = "pre-launch" @@ -173,7 +173,7 @@ class TestCloudSyncProgressDialogCallbacks(unittest.TestCase): """Create a dialog with all GTK interactions mocked out.""" game = _make_game() sync_func = MagicMock(return_value=[]) - dialog = object.__new__(CloudSyncProgressDialog) + dialog = CloudSyncProgressDialog.__new__(CloudSyncProgressDialog) dialog.game = game dialog._sync_func = sync_func dialog._direction = "pre-launch" @@ -281,7 +281,7 @@ class TestCloudSyncProgressDialogSkip(unittest.TestCase): def _make_dialog(self): game = _make_game() sync_func = MagicMock(return_value=[]) - dialog = object.__new__(CloudSyncProgressDialog) + dialog = CloudSyncProgressDialog.__new__(CloudSyncProgressDialog) dialog.game = game dialog._sync_func = sync_func dialog._direction = "pre-launch" diff --git a/tests/test_gog_cloud.py b/tests/test_gog_cloud.py index 620ecba56..ffb129210 100644 --- a/tests/test_gog_cloud.py +++ b/tests/test_gog_cloud.py @@ -301,7 +301,7 @@ class TestGOGCloudStorageClient(unittest.TestCase): def test_download_file(self): mock_response = MagicMock() - mock_response.read.return_value = b"save file content" + mock_response.read.return_value = gzip.compress(b"save file content") mock_response.getheaders.return_value = [("X-Object-Meta-LocalLastModified", "2024-01-15T10:00:00+00:00")] with tempfile.TemporaryDirectory() as tmpdir: @@ -339,7 +339,7 @@ class TestGOGCloudStorageClient(unittest.TestCase): def test_download_file_invalid_timestamp(self): mock_response = MagicMock() - mock_response.read.return_value = b"data" + mock_response.read.return_value = gzip.compress(b"data") mock_response.getheaders.return_value = [("X-Object-Meta-LocalLastModified", "not a date")] with tempfile.TemporaryDirectory() as tmpdir: