diff --git a/README.md b/README.md index daee235..4ec2e51 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Ice's official documentation is available at [Getting Started.](http://scottrice ###Running the Source -You will need Python 2.7 to run Ice. Python 3.0 and up will not work. +You will need Python 2.7 or Python 3.0 and up to run Ice. You will also need pip installed. The easiest way to get that is to run `easy_install pip`. diff --git a/src/ice-qt.py b/src/ice-qt.py index 561e41d..e32e422 100755 --- a/src/ice-qt.py +++ b/src/ice-qt.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +from __future__ import print_function import sys import traceback @@ -16,7 +17,9 @@ traceback.print_exc() sys.stderr = stderr traceback.print_exc() - print "" - print "An error has occurred! A copy of the crash report has been saved to 'error.log'." - print "If this continues please submit an issue on our Github page (http://github.com/scottrice/Ice)" - raw_input() + print("") + print("An error has occurred! A copy of the crash report has been saved to 'error.log'.") + print("If this continues please submit an issue on our Github page (http://github.com/scottrice/Ice)") + try: input = raw_input + except NameError: pass + input() diff --git a/src/ice.py b/src/ice.py index 068c2b3..c8f9cb4 100755 --- a/src/ice.py +++ b/src/ice.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +from __future__ import print_function import sys import traceback @@ -16,7 +17,8 @@ traceback.print_exc() sys.stderr = stderr traceback.print_exc() - print "" - print "An error has occurred! A copy of the crash report has been saved to 'error.log'." - print "If this continues please submit an issue on our Github page (http://github.com/scottrice/Ice)" - raw_input() + print("") + print("An error has occurred! A copy of the crash report has been saved to 'error.log'.") + print("If this continues please submit an issue on our Github page (http://github.com/scottrice/Ice)") + try: raw_input() + except NameError: input() diff --git a/src/ice/configuration.py b/src/ice/configuration.py index 92e9788..a6488cd 100644 --- a/src/ice/configuration.py +++ b/src/ice/configuration.py @@ -13,9 +13,9 @@ import datetime import os -from persistence.backed_object_manager import BackedObjectManager -from persistence.adapters.console_adapter import ConsoleBackedObjectAdapter -from persistence.adapters.emulator_adapter import EmulatorBackedObjectAdapter +from ice.persistence.backed_object_manager import BackedObjectManager +from ice.persistence.adapters.console_adapter import ConsoleBackedObjectAdapter +from ice.persistence.adapters.emulator_adapter import EmulatorBackedObjectAdapter class Configuration(object): diff --git a/src/ice/console.py b/src/ice/console.py index 1191df7..86a953e 100644 --- a/src/ice/console.py +++ b/src/ice/console.py @@ -16,7 +16,7 @@ import os -from rom import ROM +from ice.rom import ROM class Console(object): diff --git a/src/ice/emulator.py b/src/ice/emulator.py index 1087e79..b9a50cc 100644 --- a/src/ice/emulator.py +++ b/src/ice/emulator.py @@ -16,8 +16,8 @@ import tempfile import shutil -from persistence.backed_object import BackedObject -import utils +from ice.persistence.backed_object import BackedObject +import ice.utils class Emulator(BackedObject): diff --git a/src/ice/environment_checker.py b/src/ice/environment_checker.py index 46a20b3..38f20cd 100644 --- a/src/ice/environment_checker.py +++ b/src/ice/environment_checker.py @@ -7,9 +7,9 @@ import psutil import sys -from error.path_existance_error import PathExistanceError -from error.process_running_error import ProcessRunningError -from error.writable_path_error import WritablePathError +from ice.error.path_existance_error import PathExistanceError +from ice.error.process_running_error import ProcessRunningError +from ice.error.writable_path_error import WritablePathError class EnvironmentChecker(object): diff --git a/src/ice/error/path_existance_error.py b/src/ice/error/path_existance_error.py index 423d19a..a4b5a23 100644 --- a/src/ice/error/path_existance_error.py +++ b/src/ice/error/path_existance_error.py @@ -1,6 +1,6 @@ import os -from env_checker_error import EnvCheckerError +from ice.error.env_checker_error import EnvCheckerError class PathExistanceError(Exception): diff --git a/src/ice/error/process_running_error.py b/src/ice/error/process_running_error.py index f7a210f..705954b 100644 --- a/src/ice/error/process_running_error.py +++ b/src/ice/error/process_running_error.py @@ -1,4 +1,4 @@ -from env_checker_error import EnvCheckerError +from ice.error.env_checker_error import EnvCheckerError class ProcessRunningError(Exception): diff --git a/src/ice/error/writable_path_error.py b/src/ice/error/writable_path_error.py index 742be30..4b49350 100644 --- a/src/ice/error/writable_path_error.py +++ b/src/ice/error/writable_path_error.py @@ -1,4 +1,4 @@ -from env_checker_error import EnvCheckerError +from ice.error.env_checker_error import EnvCheckerError class WritablePathError(Exception): diff --git a/src/ice/filesystem.py b/src/ice/filesystem.py index e94bc60..b1414c6 100644 --- a/src/ice/filesystem.py +++ b/src/ice/filesystem.py @@ -26,7 +26,7 @@ def _paths_in_directory(self, directory): return [os.path.join(directory, name) for name in glob.glob(pattern)] def files_in_directory(self, directory): - return filter(os.path.isfile, self._paths_in_directory(directory)) + return list(filter(os.path.isfile, self._paths_in_directory(directory))) def subdirectories_of_directory(self, directory): - return filter(os.path.isdir, self._paths_in_directory(directory)) + return list(filter(os.path.isdir, self._paths_in_directory(directory))) diff --git a/src/ice/gridproviders/combined_provider.py b/src/ice/gridproviders/combined_provider.py index 819ce69..b8a7228 100644 --- a/src/ice/gridproviders/combined_provider.py +++ b/src/ice/gridproviders/combined_provider.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 -import grid_image_provider +from ice.gridproviders import grid_image_provider from functools import reduce diff --git a/src/ice/gridproviders/consolegrid_provider.py b/src/ice/gridproviders/consolegrid_provider.py index 084a9d5..7a531c7 100644 --- a/src/ice/gridproviders/consolegrid_provider.py +++ b/src/ice/gridproviders/consolegrid_provider.py @@ -9,10 +9,18 @@ import sys import os -import urllib -import urllib2 +try: + from urllib import quote + from urllib import urlretrieve + from urllib2 import urlopen + from urllib2 import URLError +except: + from urllib.request import quote + from urllib.request import urlretrieve + from urllib.request import urlopen + from urllib.request import URLError -import grid_image_provider +from ice.gridproviders import grid_image_provider class ConsoleGridProvider(grid_image_provider.GridImageProvider): @@ -31,7 +39,7 @@ def is_enabled(): def consolegrid_top_picture_url(self, rom): host = self.api_url() - quoted_name = urllib.quote(rom.name()) + quoted_name = quote(rom.name()) return "%s?console=%s&game=%s" % (host, rom.console.shortname, quoted_name) def find_url_for_rom(self, rom): @@ -40,7 +48,7 @@ def find_url_for_rom(self, rom): ConsoleGrid.com """ try: - response = urllib2.urlopen(self.consolegrid_top_picture_url(rom)) + response = urlopen(self.consolegrid_top_picture_url(rom)) if response.getcode() == 204: name = rom.name() console = rom.console.fullname @@ -49,7 +57,7 @@ def find_url_for_rom(self, rom): ) else: return response.read() - except urllib2.URLError as error: + except URLError as error: # Connection was refused. ConsoleGrid may be down, or something bad # may have happened self.logger.debug( @@ -61,7 +69,7 @@ def download_image(self, url): Downloads the image at 'url' and returns the path to the image on the local filesystem """ - (path, headers) = urllib.urlretrieve(url) + (path, headers) = urlretrieve(url) return path def image_for_rom(self, rom): diff --git a/src/ice/gridproviders/local_provider.py b/src/ice/gridproviders/local_provider.py index b71e7d5..630d902 100644 --- a/src/ice/gridproviders/local_provider.py +++ b/src/ice/gridproviders/local_provider.py @@ -10,7 +10,7 @@ import sys import os -import grid_image_provider +from ice.gridproviders import grid_image_provider class LocalProvider(grid_image_provider.GridImageProvider): diff --git a/src/ice/gui/steam_preview_widget.py b/src/ice/gui/steam_preview_widget.py index b9b1038..7197e3c 100644 --- a/src/ice/gui/steam_preview_widget.py +++ b/src/ice/gui/steam_preview_widget.py @@ -6,7 +6,7 @@ from PyQt4 import QtGui -from steam_shortcut_widget import SteamShortcutWidget +from ice.gui.steam_shortcut_widget import SteamShortcutWidget class SteamPreviewWidget(QtGui.QWidget): diff --git a/src/ice/persistence/config_file_backing_store.py b/src/ice/persistence/config_file_backing_store.py index f713088..88c3a2e 100644 --- a/src/ice/persistence/config_file_backing_store.py +++ b/src/ice/persistence/config_file_backing_store.py @@ -6,9 +6,10 @@ Copyright (c) 2014 Scott Rice. All rights reserved. """ -import ConfigParser +try: import ConfigParser +except: import configparser as ConfigParser -import backing_store +from ice.persistence import backing_store class ConfigFileBackingStore(backing_store.BackingStore): diff --git a/src/ice/rom.py b/src/ice/rom.py index 35043e2..a39b021 100644 --- a/src/ice/rom.py +++ b/src/ice/rom.py @@ -40,8 +40,9 @@ def name(self): name_with_ext = os.path.basename(self.path) # normalize the name to get rid of symbols that break the shortcuts.vdf - name_with_ext = unicodedata.normalize( - 'NFKD', unicode(name_with_ext.decode('utf-8'))).encode('ascii', 'ignore') + try: name_with_ext = unicode(name_with_ext.decode('utf-8')) + except: pass + name_with_ext = unicodedata.normalize('NFKD', name_with_ext).encode('ascii', 'ignore').decode('ascii') dot_index = name_with_ext.rfind('.') if dot_index == -1: diff --git a/src/ice/rom_finder.py b/src/ice/rom_finder.py index bdda467..b632b8d 100644 --- a/src/ice/rom_finder.py +++ b/src/ice/rom_finder.py @@ -1,6 +1,6 @@ -from console import Console -from rom import ROM +from ice.console import Console +from ice.rom import ROM from functools import reduce @@ -27,7 +27,7 @@ def roms_for_console(self, console): roms_directory = self.config.roms_directory_for_console(console) paths = self.filesystem.files_in_directory(roms_directory) valid_rom_paths = filter(console.is_valid_rom, paths) - return map(lambda path: ROM(path, console), valid_rom_paths) + return list(map(lambda path: ROM(path, console), valid_rom_paths)) def roms_for_consoles(self, consoles): """ diff --git a/src/ice/runners/command_line_runner.py b/src/ice/runners/command_line_runner.py index 4a31947..b586dc1 100644 --- a/src/ice/runners/command_line_runner.py +++ b/src/ice/runners/command_line_runner.py @@ -5,7 +5,8 @@ Copyright (c) 2014 Scott Rice. All rights reserved. """ -from ice_engine import IceEngine +from __future__ import print_function +from ice.runners.ice_engine import IceEngine class CommandLineRunner(object): @@ -16,6 +17,7 @@ def run(self, argv): engine.run() # Keeps the console from closing (until the user hits enter) so they can # read any console output - print "" - print "Close the window, or hit enter to exit..." - raw_input() + print("") + print("Close the window, or hit enter to exit...") + try: raw_input() + except NameError: input() diff --git a/src/ice/steam_shortcut_synchronizer.py b/src/ice/steam_shortcut_synchronizer.py index 0870689..76ee676 100644 --- a/src/ice/steam_shortcut_synchronizer.py +++ b/src/ice/steam_shortcut_synchronizer.py @@ -1,5 +1,5 @@ -from rom import ICE_FLAG_TAG +from ice.rom import ICE_FLAG_TAG class SteamShortcutSynchronizer(object): @@ -11,17 +11,17 @@ def shortcut_is_managed_by_ice(self, managed_ids, shortcut): return shortcut.appid() in managed_ids or ICE_FLAG_TAG in shortcut.tags def unmanaged_shortcuts(self, managed_ids, shortcuts): - return filter(lambda shortcut: not self.shortcut_is_managed_by_ice(managed_ids, shortcut), shortcuts) + return list(filter(lambda shortcut: not self.shortcut_is_managed_by_ice(managed_ids, shortcut), shortcuts)) def removed_shortcuts(self, current_shortcuts, new_shortcuts): # To get the list of only removed shortcuts we take all of the current # shortcuts and filter out any that exist in the new shortcuts - return filter(lambda shortcut: shortcut not in new_shortcuts, current_shortcuts) + return [shortcut for shortcut in current_shortcuts if shortcut not in new_shortcuts] def added_shortcuts(self, current_shortcuts, new_shortcuts): # To get the list of only added shortcuts we take all of the new shortcuts # and filter out any that existed in the current shortcuts - return filter(lambda shortcut: shortcut not in current_shortcuts, new_shortcuts) + return [shortcut for shortcut in new_shortcuts if shortcut not in current_shortcuts] def sync_roms_for_user(self, user, roms): """ @@ -34,20 +34,22 @@ def sync_roms_for_user(self, user, roms): # to Plex would be 'Unmanaged' previous_managed_ids = self.managed_rom_archive.previous_managed_ids(user) unmanaged_shortcuts = self.unmanaged_shortcuts(previous_managed_ids, user.shortcuts) - current_ice_shortcuts = filter(lambda shortcut: shortcut not in unmanaged_shortcuts, user.shortcuts) + current_ice_shortcuts = list(filter(lambda shortcut: shortcut not in unmanaged_shortcuts, user.shortcuts)) # Generate a list of shortcuts out of our list of ROMs - rom_shortcuts = map(lambda rom: rom.to_shortcut(), roms) + rom_shortcuts = list(map(lambda rom: rom.to_shortcut(), roms)) # Calculate which ROMs were added and which were removed so we can inform # the user removed = self.removed_shortcuts(current_ice_shortcuts, rom_shortcuts) - map(lambda shortcut: self.logger.info("Removing ROM: `%s`" % shortcut.name), removed) + for shortcut in removed: + self.logger.info("Removing ROM: `%s`" % shortcut.name) added = self.added_shortcuts(current_ice_shortcuts, rom_shortcuts) - map(lambda shortcut: self.logger.info("Adding ROM: `%s`" % shortcut.name), added) + for shortcut in added: + self.logger.info("Adding ROM: `%s`" % shortcut.name) # Set the updated shortcuts user.shortcuts = unmanaged_shortcuts + rom_shortcuts user.save_shortcuts() # Update the archive - new_managed_ids = map(lambda shortcut: shortcut.appid(), rom_shortcuts) + new_managed_ids = list(map(lambda shortcut: shortcut.appid(), rom_shortcuts)) self.managed_rom_archive.set_managed_ids(user, new_managed_ids) diff --git a/src/ice/tests/environment_checker_tests.py b/src/ice/tests/environment_checker_tests.py index 356d8d2..a27a00e 100644 --- a/src/ice/tests/environment_checker_tests.py +++ b/src/ice/tests/environment_checker_tests.py @@ -14,7 +14,13 @@ def setUp(self): self.tempdir = tempfile.mkdtemp() def tearDown(self): - shutil.rmtree(self.tempdir) + def del_rw(action, name, exc): + for root, subdirs, files in os.walk(name): + for filename in subdirs + files: + subdir_filename = os.path.join(root, filename) + os.chmod(name, stat.S_IWRITE) + shutil.rmtree(subdir_filename, onerror=del_rw) + shutil.rmtree(self.tempdir, onerror=del_rw) def testRequireDirectoryExistsSucceedsWhenDirectoryExists(self): try: diff --git a/src/ice/tests/filesystem_tests.py b/src/ice/tests/filesystem_tests.py index ea21557..c895744 100644 --- a/src/ice/tests/filesystem_tests.py +++ b/src/ice/tests/filesystem_tests.py @@ -55,7 +55,7 @@ def test_files_in_directory_only_returns_files(self): os.mkdir(dir1) dir2 = os.path.join(self.tempdir, "dir2") os.mkdir(dir2) - self.assertEquals( + self.assertEqual( self.filesystem.files_in_directory( self.tempdir), [ file1, file2]) @@ -71,7 +71,7 @@ def test_files_in_directory_doesnt_return_hidden_files(self): os.mkdir(dir1) dir2 = os.path.join(self.tempdir, "dir2") os.mkdir(dir2) - self.assertEquals( + self.assertEqual( self.filesystem.files_in_directory( self.tempdir), [ file1, file2]) @@ -97,7 +97,7 @@ def test_subdirectories_of_directory_only_returns_directories(self): os.mkdir(dir1) dir2 = os.path.join(self.tempdir, "dir2") os.mkdir(dir2) - self.assertEquals( + self.assertEqual( self.filesystem.subdirectories_of_directory( self.tempdir), [ dir1, dir2]) diff --git a/src/ice/tests/rom_finder_tests.py b/src/ice/tests/rom_finder_tests.py index ff0beff..7e97195 100644 --- a/src/ice/tests/rom_finder_tests.py +++ b/src/ice/tests/rom_finder_tests.py @@ -31,10 +31,10 @@ def test_roms_for_console_returns_a_rom_for_every_file_in_roms_directory( self.mock_filesystem.files_in_directory.return_value = rom_paths roms = self.rom_finder.roms_for_console(self.mock_console) - self.assertEquals(len(roms), 3) + self.assertEqual(len(roms), 3) for rom in roms: self.assertIn(rom.path, rom_paths) - self.assertEquals(rom.console, self.mock_console) + self.assertEqual(rom.console, self.mock_console) def test_roms_for_console_ignores_invalid_roms(self): dirname = "RandomDir" @@ -46,7 +46,7 @@ def test_roms_for_console_ignores_invalid_roms(self): self.mock_config.roms_directory_for_console.return_value = dirname self.mock_filesystem.files_in_directory.return_value = rom_paths - self.assertEquals([], self.rom_finder.roms_for_console(self.mock_console)) + self.assertEqual([], self.rom_finder.roms_for_console(self.mock_console)) def test_roms_for_console_returns_nothing_for_disabled_consoles(self): dirname = "RandomDir" @@ -58,7 +58,7 @@ def test_roms_for_console_returns_nothing_for_disabled_consoles(self): console = mock.MagicMock() console.is_enabled.return_value = False - self.assertEquals(self.rom_finder.roms_for_console(console), []) + self.assertEqual(self.rom_finder.roms_for_console(console), []) def test_roms_for_consoles_returns_collection_of_all_roms(self): firstdir = "RandomDir" @@ -80,13 +80,13 @@ def fake_roms_directory_for_console(console): both_consoles = [console1, console2] roms = self.rom_finder.roms_for_consoles([console1]) - self.assertEquals(len(roms), 2) + self.assertEqual(len(roms), 2) for rom in roms: self.assertIn(rom.path, rom_paths) - self.assertEquals(rom.console, console1) + self.assertEqual(rom.console, console1) roms = self.rom_finder.roms_for_consoles(both_consoles) - self.assertEquals(len(roms), 3) + self.assertEqual(len(roms), 3) for rom in roms: self.assertIn(rom.path, rom_paths) self.assertIn(rom.console, both_consoles) diff --git a/src/ice/tests/steam_shortcut_synchronizer_tests.py b/src/ice/tests/steam_shortcut_synchronizer_tests.py index 3b9992a..e8630b8 100644 --- a/src/ice/tests/steam_shortcut_synchronizer_tests.py +++ b/src/ice/tests/steam_shortcut_synchronizer_tests.py @@ -18,12 +18,12 @@ def setUp(self): def test_unmanaged_shortcuts_returns_shortcut_not_affiliated_with_ice(self): random_shortcut = Shortcut("Plex", "/Some/Random/Path/plex", "/Some/Random/Path") unmanaged = self.synchronizer.unmanaged_shortcuts([],[random_shortcut]) - self.assertEquals(unmanaged, [random_shortcut]) + self.assertEqual(unmanaged, [random_shortcut]) def test_unmanaged_shortcuts_doesnt_return_shortcut_with_flag_tag(self): tagged_shortcut = Shortcut("Game", "/Path/to/game", "/Path/to", "", ICE_FLAG_TAG) unmanaged = self.synchronizer.unmanaged_shortcuts([],[tagged_shortcut]) - self.assertEquals(unmanaged, []) + self.assertEqual(unmanaged, []) def test_unmanaged_shortcuts_doesnt_return_shortcut_with_appid_in_managed_ids(self): managed_shortcut = Shortcut("Game", "/Path/to/game", "/Path/to", "") @@ -31,20 +31,20 @@ def test_unmanaged_shortcuts_doesnt_return_shortcut_with_appid_in_managed_ids(se managed_ids = [managed_shortcut.appid()] shortcuts = [managed_shortcut, random_shortcut] unmanaged = self.synchronizer.unmanaged_shortcuts(managed_ids,shortcuts) - self.assertEquals(unmanaged, [random_shortcut]) + self.assertEqual(unmanaged, [random_shortcut]) def test_added_shortcuts_doesnt_return_shortcuts_that_still_exist(self): shortcut1 = Shortcut("Game1", "/Path/to/game1", "/Path/to", "", ICE_FLAG_TAG) shortcut2 = Shortcut("Game2", "/Path/to/game2", "/Path/to", "", ICE_FLAG_TAG) old = [shortcut1, shortcut2] new = [shortcut1, shortcut2] - self.assertEquals(self.synchronizer.added_shortcuts(old, new), []) + self.assertEqual(self.synchronizer.added_shortcuts(old, new), []) def test_added_shortcuts_returns_shortcuts_that_didnt_exist_previously(self): shortcut1 = Shortcut("Game1", "/Path/to/game1", "/Path/to", "", ICE_FLAG_TAG) shortcut2 = Shortcut("Game2", "/Path/to/game2", "/Path/to", "", ICE_FLAG_TAG) new = [shortcut1, shortcut2] - self.assertEquals(self.synchronizer.added_shortcuts([], new), [shortcut1, shortcut2]) + self.assertEqual(self.synchronizer.added_shortcuts([], new), [shortcut1, shortcut2]) def test_added_shortcuts_only_returns_shortcuts_that_exist_now_but_not_before(self): shortcut1 = Shortcut("Game1", "/Path/to/game1", "/Path/to", "", ICE_FLAG_TAG) @@ -53,21 +53,21 @@ def test_added_shortcuts_only_returns_shortcuts_that_exist_now_but_not_before(se shortcut4 = Shortcut("Game4", "/Path/to/game4", "/Path/to", "", ICE_FLAG_TAG) old = [shortcut1, shortcut2] new = [shortcut1, shortcut2, shortcut3, shortcut4] - self.assertEquals(self.synchronizer.added_shortcuts(old, new), [shortcut3, shortcut4]) + self.assertEqual(self.synchronizer.added_shortcuts(old, new), [shortcut3, shortcut4]) def test_removed_shortcuts_doesnt_return_shortcuts_that_still_exist(self): shortcut1 = Shortcut("Game1", "/Path/to/game1", "/Path/to", "", ICE_FLAG_TAG) shortcut2 = Shortcut("Game2", "/Path/to/game2", "/Path/to", "", ICE_FLAG_TAG) old = [shortcut1, shortcut2] new = [shortcut1, shortcut2] - self.assertEquals(self.synchronizer.removed_shortcuts(old, new), []) + self.assertEqual(self.synchronizer.removed_shortcuts(old, new), []) def test_removed_shortcuts_returns_shortcuts_that_dont_exist_anymore(self): shortcut1 = Shortcut("Game1", "/Path/to/game1", "/Path/to", "", ICE_FLAG_TAG) shortcut2 = Shortcut("Game2", "/Path/to/game2", "/Path/to", "", ICE_FLAG_TAG) old = [shortcut1, shortcut2] new = [] - self.assertEquals(self.synchronizer.removed_shortcuts(old, new), [shortcut1, shortcut2]) + self.assertEqual(self.synchronizer.removed_shortcuts(old, new), [shortcut1, shortcut2]) def test_removed_shortcuts_only_returns_shortcuts_that_dont_exist_now_but_did_before(self): shortcut1 = Shortcut("Game1", "/Path/to/game1", "/Path/to", "", ICE_FLAG_TAG) @@ -76,7 +76,7 @@ def test_removed_shortcuts_only_returns_shortcuts_that_dont_exist_now_but_did_be shortcut4 = Shortcut("Game4", "/Path/to/game4", "/Path/to", "", ICE_FLAG_TAG) old = [shortcut1, shortcut2, shortcut3, shortcut4] new = [shortcut1, shortcut2] - self.assertEquals(self.synchronizer.removed_shortcuts(old, new), [shortcut3, shortcut4]) + self.assertEqual(self.synchronizer.removed_shortcuts(old, new), [shortcut3, shortcut4]) def test_sync_roms_for_user_keeps_unmanaged_shortcuts(self): random_shortcut = Shortcut("Plex", "/Some/Random/Path/plex", "/Some/Random/Path") @@ -99,7 +99,7 @@ def test_sync_roms_for_user_keeps_unmanaged_shortcuts(self): self.synchronizer.sync_roms_for_user(self.mock_user, [rom1, rom2, rom3, rom4]) new_shortcuts = self.mock_user.shortcuts - self.assertEquals(len(new_shortcuts), 5) + self.assertEqual(len(new_shortcuts), 5) self.assertIn(random_shortcut, new_shortcuts) self.assertIn(shortcut1, new_shortcuts) self.assertIn(shortcut2, new_shortcuts) @@ -126,7 +126,7 @@ def test_sync_roms_for_user_logs_once_for_each_added_rom(self): rom3.to_shortcut.return_value = shortcut3 self.synchronizer.sync_roms_for_user(self.mock_user, [rom1, rom2, rom3]) - self.assertEquals(self.mock_logger.info.call_count, 3) + self.assertEqual(self.mock_logger.info.call_count, 3) def test_sync_roms_for_user_logs_when_a_rom_is_removed(self): shortcut = Shortcut("Game", "/Path/to/game", "/Path/to", "", ICE_FLAG_TAG) @@ -142,7 +142,7 @@ def test_sync_roms_for_user_logs_once_for_each_removed_rom(self): self.mock_user.shortcuts = [shortcut1, shortcut2, shortcut3] self.synchronizer.sync_roms_for_user(self.mock_user, []) - self.assertEquals(self.mock_logger.info.call_count, 3) + self.assertEqual(self.mock_logger.info.call_count, 3) def test_sync_roms_for_user_both_adds_and_removes_roms(self): shortcut1 = Shortcut("Game1", "/Path/to/game1", "/Path/to", "", ICE_FLAG_TAG) @@ -162,8 +162,8 @@ def test_sync_roms_for_user_both_adds_and_removes_roms(self): self.synchronizer.sync_roms_for_user(self.mock_user, [rom1, rom2, rom3]) new_shortcuts = self.mock_user.shortcuts - self.assertEquals(self.mock_logger.info.call_count, 2) - self.assertEquals(len(new_shortcuts), 3) + self.assertEqual(self.mock_logger.info.call_count, 2) + self.assertEqual(len(new_shortcuts), 3) self.assertIn(shortcut1, new_shortcuts) self.assertIn(shortcut2, new_shortcuts) self.assertIn(shortcut3, new_shortcuts) @@ -176,7 +176,7 @@ def test_sync_roms_for_user_saves_shortcuts_after_running(self): self.mock_user.shortcuts = [] self.synchronizer.sync_roms_for_user(self.mock_user, [rom1]) - self.assertEquals(self.mock_user.shortcuts, [shortcut1]) + self.assertEqual(self.mock_user.shortcuts, [shortcut1]) self.assertTrue(self.mock_user.save_shortcuts.called) def test_sync_roms_for_user_sets_managed_ids(self):