Skip to content

Commit 92897a0

Browse files
authoredJul 18, 2019
fix: create and update app with space in setup (#281)
* create and update app with space in setup * fix lint errors * use escaped name for app with spaces * fix linter errors
1 parent f48d15b commit 92897a0

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed
 

‎tests/cli/run/tests/run_tests.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
class TnsRunJSTests(TnsRunTest):
2929
app_name = Settings.AppName.DEFAULT
3030
app_name_space = Settings.AppName.WITH_SPACE
31+
normalized_app_name_space = '"' + app_name_space + '"'
3132
app_path = TnsPaths.get_app_path(app_name)
3233
app_resources_path = TnsPaths.get_path_app_resources(app_name)
3334
source_project_dir = TnsPaths.get_app_path(app_name)
@@ -44,9 +45,17 @@ def setUpClass(cls):
4445
src = os.path.join(Settings.TEST_RUN_HOME, 'assets', 'logs', 'hello-world-js', 'app.js')
4546
target = os.path.join(cls.app_path, 'app')
4647
File.copy(source=src, target=target)
48+
49+
# Create app with space in name
50+
Tns.create(app_name=cls.app_name_space, template=Template.HELLO_WORLD_JS.local_package, update=True)
51+
4752
Tns.platform_add_android(app_name=cls.app_name, framework_path=Settings.Android.FRAMEWORK_PATH)
53+
Tns.platform_add_android(app_name=cls.normalized_app_name_space, verify=False,
54+
framework_path=Settings.Android.FRAMEWORK_PATH)
4855
if Settings.HOST_OS is OSType.OSX:
4956
Tns.platform_add_ios(app_name=cls.app_name, framework_path=Settings.IOS.FRAMEWORK_PATH)
57+
Tns.platform_add_ios(app_name=cls.normalized_app_name_space, verify=False,
58+
framework_path=Settings.IOS.FRAMEWORK_PATH)
5059

5160
# Copy TestApp to data folder.
5261
Folder.copy(source=cls.source_project_dir, target=cls.target_project_dir)
@@ -742,18 +751,14 @@ def test_360_tns_run_android_on_folder_with_spaces(self):
742751
"""
743752
`tns run android` for apps with spaces
744753
"""
745-
Tns.create(app_name=self.app_name_space, template=Template.HELLO_WORLD_JS.local_package, update=True)
746-
app_name = '"' + self.app_name_space + '"'
747-
run_hello_world_js_ts(app_name, Platform.ANDROID, self.emu, just_launch=True)
754+
run_hello_world_js_ts(self.normalized_app_name_space, Platform.ANDROID, self.emu, just_launch=True)
748755

749756
@unittest.skipIf(Settings.HOST_OS != OSType.OSX, 'iOS tests can be executed only on macOS.')
750757
def test_361_tns_run_ios_on_folder_with_spaces(self):
751758
"""
752759
`tns run ios` for apps with spaces
753760
"""
754-
Tns.create(app_name=self.app_name_space, template=Template.HELLO_WORLD_JS.local_package, update=True)
755-
app_name = '"' + self.app_name_space + '"'
756-
run_hello_world_js_ts(app_name, Platform.IOS, self.sim, just_launch=True)
761+
run_hello_world_js_ts(self.normalized_app_name_space, Platform.IOS, self.sim, just_launch=True)
757762

758763
@unittest.skip("Skip this test due to emulator api28 ui crashing when no space left on device")
759764
@unittest.skipIf(Settings.HOST_OS != OSType.OSX, '`shell cp -r` fails on emulators on Linux and Win.')

0 commit comments

Comments
 (0)