|
@@ 137-168 (lines=32) @@
|
| 134 |
|
|
| 135 |
|
self.assertTrue(skin_path_exists) |
| 136 |
|
|
| 137 |
|
def test_check_skin_folder_already_exists_existing(self): |
| 138 |
|
""" |
| 139 |
|
Given |
| 140 |
|
installing a skin with name BeatTime from a folder |
| 141 |
|
|
| 142 |
|
Then |
| 143 |
|
checking after the installation if that skin already exists |
| 144 |
|
|
| 145 |
|
Should |
| 146 |
|
detect an already existing skin |
| 147 |
|
""" |
| 148 |
|
tests_folder = os.path.dirname(os.path.abspath(__file__)) |
| 149 |
|
folder_path = os.path.join(tests_folder, "skin_folder") |
| 150 |
|
|
| 151 |
|
# we need to make a temp copy first since we do not want to delete our original test data |
| 152 |
|
with tempfile.TemporaryDirectory() as temp_path: |
| 153 |
|
dst_path = os.path.join(temp_path, "skin_folder") |
| 154 |
|
shutil.copytree(folder_path, dst_path) |
| 155 |
|
|
| 156 |
|
actual_skin_path = FOLDER_INSTALLER.install_skin_folder_into_skins_folder(dst_path) |
| 157 |
|
self.assertTrue(len(actual_skin_path) > 0) |
| 158 |
|
self.assertTrue(os.path.isdir(actual_skin_path)) |
| 159 |
|
|
| 160 |
|
skins_path = SKIN_PATH_PROVIDER.get_cached_skin_path() |
| 161 |
|
skin_path = os.path.join(skins_path, "BeatTime") |
| 162 |
|
skin_path_exists = FOLDER_INSTALLER.check_skin_folder_already_exists(dst_path) |
| 163 |
|
self.assertEquals(actual_skin_path, skin_path) |
| 164 |
|
|
| 165 |
|
# cleanup the installed skin to make it reproduceable |
| 166 |
|
shutil.rmtree(skin_path) |
| 167 |
|
|
| 168 |
|
self.assertTrue(skin_path_exists) |
| 169 |
|
|
| 170 |
|
def test_check_skin_folder_already_exists_not_existing(self): |
| 171 |
|
tests_folder = os.path.dirname(os.path.abspath(__file__)) |
|
@@ 114-135 (lines=22) @@
|
| 111 |
|
self.assertTrue(skin_path_exists) |
| 112 |
|
self.assertTrue(resources_path_exists) |
| 113 |
|
|
| 114 |
|
def test_install_multi_skin_folder_into_skins_folder(self): |
| 115 |
|
tests_folder = os.path.dirname(os.path.abspath(__file__)) |
| 116 |
|
folder_path = os.path.join(tests_folder, "multi_skin_folder") |
| 117 |
|
|
| 118 |
|
# we need to make a temp copy first since we do not want to delete our original test data |
| 119 |
|
with tempfile.TemporaryDirectory() as temp_path: |
| 120 |
|
dst_path = os.path.join(temp_path, "multi_skin_folder") |
| 121 |
|
shutil.copytree(folder_path, dst_path) |
| 122 |
|
|
| 123 |
|
actual_skin_path = FOLDER_INSTALLER.install_skin_folder_into_skins_folder(dst_path) |
| 124 |
|
self.assertTrue(os.path.isdir(actual_skin_path)) |
| 125 |
|
|
| 126 |
|
skins_path = SKIN_PATH_PROVIDER.get_cached_skin_path() |
| 127 |
|
skin_path = os.path.join(skins_path, "Miniml") |
| 128 |
|
skin_path_exists = os.path.exists(skin_path) |
| 129 |
|
|
| 130 |
|
self.assertEquals(actual_skin_path, skin_path) |
| 131 |
|
|
| 132 |
|
# cleanup |
| 133 |
|
shutil.rmtree(skin_path) |
| 134 |
|
|
| 135 |
|
self.assertTrue(skin_path_exists) |
| 136 |
|
|
| 137 |
|
def test_check_skin_folder_already_exists_existing(self): |
| 138 |
|
""" |