<s> import os <EOL> import unittest <EOL> from pysteam import model <EOL> from . . testinfra . fake_environment import FakeEnvironment <EOL> class SmokeTests ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . env = FakeEnvironment ( __file__ ) <EOL> def tearDown ( self ) : <EOL> self . env . clean ( ) <EOL> def test_add_single_rom ( self ) : <EOL> self . env . load_test_data ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> u1 = self . env . create_fake_user ( ) <EOL> self . env . run_command ( ) <EOL> self . assertEqual ( self . env . user_shortcuts ( u1 ) , self . env . expected_shortcuts ( ) ) <EOL> def test_add_rom_for_two_users_with_different_preexisting_shortcuts ( self ) : <EOL> self . env . load_test_data ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> u1 = self . env . create_fake_user ( ) <EOL> u2 = self . env . create_fake_user ( ) <EOL> u2_shortcut = model . Shortcut ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , [ ] ) <EOL> preexisting_shortcuts = [ u2_shortcut ] <EOL> self . env . set_user_shortcuts ( u2 , preexisting_shortcuts ) <EOL> self . env . run_command ( ) <EOL> expected = self . env . expected_shortcuts ( ) <EOL> u1_synced_shortcuts = self . env . user_shortcuts ( u1 ) <EOL> self . assertNotIn ( u2_shortcut , u1_synced_shortcuts ) <EOL> for shortcut in expected : <EOL> self . assertIn ( shortcut , u1_synced_shortcuts ) <EOL> u2_synced_shortcuts = self . env . user_shortcuts ( u2 ) <EOL> self . assertIn ( u2_shortcut , u2_synced_shortcuts ) <EOL> for shortcut in expected : <EOL> self . assertIn ( shortcut , u2_synced_shortcuts ) </s>
