1
0
mirror of https://github.com/gryf/fs-uae-wrapper.git synced 2025-12-29 09:52:29 +01:00

Setting assets paths in base class

This commit is contained in:
2017-01-03 18:49:18 +01:00
parent 1d35436dee
commit 0b831e5b10
4 changed files with 21 additions and 14 deletions

View File

@@ -146,16 +146,18 @@ class TestBase(TestCase):
@mock.patch('fs_uae_wrapper.utils.create_archive')
def test_save_save(self, carch, saves_dir):
bobj = base.Base('Config.fs-uae', utils.CmdOption(), {})
os.chdir(self.confdir)
bobj = base.Base('myconf.fs-uae', utils.CmdOption(), {})
bobj.dir = self.dirname
bobj.save_filename = 'foobar_save.7z'
saves_dir.bobj.save_filenamereturn_value = None
bobj.save_filename = os.path.join(self.confdir, 'myconf_save.7z')
saves_dir.return_value = None
carch.return_value = True
self.assertTrue(bobj._save_save())
saves_dir.return_value = bobj.save_filename
os.chdir(self.confdir)
with open(bobj.save_filename, 'w') as fobj:
fobj.write('asd')
@@ -218,6 +220,9 @@ class TestBase(TestCase):
os.mkdir(path)
self.assertEqual(bobj._get_saves_dir(), 'saves')
bobj.all_options['save_states_dir'] = '$CONFIG/saves/'
self.assertEqual(bobj._get_saves_dir(), 'saves')
@mock.patch('fs_uae_wrapper.path.which')
def test_validate_options(self, which):