Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(fixtures.roms.banjo_kazooie, steam_model.Shortcut(
name = '[NES] Banjo Kazooie',
exe = '\"/emulators/Mednafen/mednafen\" \"/roms/nes/Banjo Kazooie.nes\"',
startdir = '/emulators/Mednafen',
icon = '/consoles/icons/nes.png',
tags = ['Nintendo Entertainment System']
))
])
def test_rom_to_shortcut(self, rom, expected):
self.assertEqual(roms.rom_to_shortcut(rom), expected)
def test_sync_roms_for_user_both_adds_and_removes_roms(self):
rom1 = model.ROM(name = 'Game1', path = '/Path/to/game1', console = fixtures.consoles.flagged)
shortcut1 = roms.rom_to_shortcut(rom1)
rom2 = model.ROM(name = 'Game2', path = '/Path/to/game2', console = fixtures.consoles.flagged)
shortcut2 = roms.rom_to_shortcut(rom2)
rom3 = model.ROM(name = 'Game3', path = '/Path/to/game3', console = fixtures.consoles.flagged)
shortcut3 = roms.rom_to_shortcut(rom3)
rom4 = model.ROM(name = 'Game4', path = '/Path/to/game4', console = fixtures.consoles.flagged)
shortcut4 = roms.rom_to_shortcut(rom4)
old_shortcuts = [shortcut1, shortcut2, shortcut4]
self._set_users_shortcuts(old_shortcuts)
self.synchronizer.sync_roms_for_user(self.user_fixture.get_context(), [rom1, rom2, rom3], None)
new_shortcuts = shortcuts.get_shortcuts(self.user_fixture.get_context())
verify(self.mock_logger, times=2).info(any())
self.assertEquals(len(new_shortcuts), 3)
(fixtures.consoles.snes, '/roms/', '/external/consoles/roms/snes'),
])
def test_console_roms_directory(self, console, config_path, expected):
config = mock()
config.roms_directory = config_path
self.assertEqual(consoles.console_roms_directory(config, console), expected)
(fixtures.consoles.nes, '/roms/', '/roms/NES'),
# SNES, on the other hand, does, so we should use the provided one
(fixtures.consoles.snes, '/roms/', '/external/consoles/roms/snes'),
])
def test_console_roms_directory(self, console, config_path, expected):
config = mock()
config.roms_directory = config_path
self.assertEqual(consoles.console_roms_directory(config, console), expected)