Fixed tests
This commit is contained in:
parent
ff8c8ac22b
commit
b1f239fe82
@ -10,9 +10,9 @@ app_type = ""
|
|||||||
def setup():
|
def setup():
|
||||||
global data_directory, app_type
|
global data_directory, app_type
|
||||||
if len(glob.glob("Uninstall.exe")) > 0: # installed copy
|
if len(glob.glob("Uninstall.exe")) > 0: # installed copy
|
||||||
if os.path.exists(paths.app_data_path("musicDL")) == False:
|
if os.path.exists(paths.data_path("musicDL")) == False:
|
||||||
paths.prepare_app_data_path("musicDL")
|
os.mkdir(paths.data_path("musicDL"))
|
||||||
data_directory = paths.app_data_path("musicDL")
|
data_directory = paths.data_path("musicDL")
|
||||||
app_type = "installed"
|
app_type = "installed"
|
||||||
else:
|
else:
|
||||||
app_type = "portable"
|
app_type = "portable"
|
||||||
|
@ -27,13 +27,13 @@ class storageTestCase(unittest.TestCase):
|
|||||||
storage.setup()
|
storage.setup()
|
||||||
self.assertEquals(storage.app_type, "installed")
|
self.assertEquals(storage.app_type, "installed")
|
||||||
self.assertTrue(os.path.exists(storage.data_directory))
|
self.assertTrue(os.path.exists(storage.data_directory))
|
||||||
self.assertEquals(storage.data_directory, paths.app_data_path("musicDL"))
|
self.assertEquals(storage.data_directory, paths.data_path("musicDL"))
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
""" Removes uninstall.exe created for tests and data path."""
|
""" Removes uninstall.exe created for tests and data path."""
|
||||||
fix_winpaths.fix()
|
fix_winpaths.fix()
|
||||||
if os.path.exists(paths.app_data_path("musicDL")):
|
if os.path.exists(paths.data_path("musicDL")):
|
||||||
shutil.rmtree(paths.app_data_path("musicDL"))
|
shutil.rmtree(paths.data_path("musicDL"))
|
||||||
if os.path.exists(os.path.join(paths.app_path(), "uninstall.exe")):
|
if os.path.exists(os.path.join(paths.app_path(), "uninstall.exe")):
|
||||||
os.remove(os.path.join(paths.app_path(), "uninstall.exe"))
|
os.remove(os.path.join(paths.app_path(), "uninstall.exe"))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user