Skip to content

Commit 6c571f5

Browse files
committed
Fix TKLiveSync check and add test for NativeScript/nativescript-cli#2764
1 parent 04f34b3 commit 6c571f5

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

core/tns/tns.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -357,20 +357,16 @@ def build_ios(attributes={}, assert_success=True, tns_path=None):
357357
if "--forDevice" in attributes.keys() or "--for-device" in attributes.keys():
358358
assert "build/device/" + app_id + ".app" in output
359359
assert File.exists(device_folder + app_id + ".ipa")
360-
output = File.read(device_folder + app_id + ".app/" + app_id)
361-
if "--release" in attributes.keys():
362-
assert "TKLiveSync" not in output, "TKLiveSync binaries available in release configuration."
363-
else:
364-
assert "TKLiveSync" in output, "TKLiveSync binaries not available in debug configuration."
360+
bundle_content = File.read(device_folder + app_id + ".app/" + app_id)
365361
else:
366362
assert "build/emulator/" + app_id + ".app" in output
367363
assert File.exists(app_name + "/platforms/ios/" + app_id + "/" + app_id + "-Prefix.pch")
368364
assert File.exists(emu_folder + app_id + ".app")
369-
output = File.read(emu_folder + app_id + ".app/" + app_id)
370-
if "--release" in attributes.keys():
371-
assert "TKLiveSync" not in output, "TKLiveSync binaries available in release configuration."
372-
else:
373-
assert "TKLiveSync" in output, "TKLiveSync binaries not available in debug configuration."
365+
bundle_content = File.read(emu_folder + app_id + ".app/" + app_id)
366+
if "--release" in attributes.keys():
367+
assert "TKLiveSync" not in bundle_content, "TKLiveSync binaries available in release configuration."
368+
else:
369+
assert "TKLiveSync" in bundle_content, "TKLiveSync binaries not available in debug configuration."
374370
return output
375371

376372
@staticmethod

tests/build/common/logtrace_tests.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
22
Tests for --log trace option.
33
"""
4-
import os
54

6-
from core.tns.tns import Tns
75
from core.base_class.BaseClass import BaseClass
86
from core.osutils.folder import Folder
97
from core.settings.settings import CURRENT_OS, OSType
8+
from core.tns.tns import Tns
9+
1010

1111
class LogtraceTests(BaseClass):
1212
def setUp(self):

tests/simulator/run_ios_tests.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from core.osutils.file import File
2525
from core.osutils.folder import Folder
2626
from core.osutils.process import Process
27-
from core.settings.settings import IOS_RUNTIME_PATH, SIMULATOR_NAME
27+
from core.settings.settings import IOS_RUNTIME_PATH, SIMULATOR_NAME, TEST_RUN_HOME
2828
from core.tns.replace_helper import ReplaceHelper
2929
from core.tns.tns import Tns
3030
from core.tns.tns_platform_type import Platform
@@ -312,3 +312,13 @@ def test_350_tns_run_ios_should_start_simulator(self):
312312
assert Simulator.wait_for_simulator(timeout=10), 'iOS Simulator not started by `tns run ios`!'
313313
else:
314314
raise nose.SkipTest('This test is not valid when devices are connected.')
315+
316+
def test_400_tns_run_on_folder_with_spaces(self):
317+
"""
318+
`tns run ios` for apps with spaces
319+
"""
320+
destination_path = os.path.join(TEST_RUN_HOME, "folder with spaces", "Test App")
321+
Folder.copy(src=self.app_name, dst=destination_path)
322+
output = Tns.run_ios(attributes={'--path': "\"" + destination_path + "\"", '--justlaunch': ''})
323+
assert "Multiple errors were thrown" not in output
324+
assert "fail" not in output

0 commit comments

Comments
 (0)