Skip to content

Commit c73bbb5

Browse files
Vasil ChimevVasil Chimev
Vasil Chimev
authored and
Vasil Chimev
committed
Update prepare tests.
1 parent 14f811f commit c73bbb5

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

tests/prepare_linux.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@ def test_200_Prepare_Android_InsideProject(self):
4343
assert not FileExists('TNS_App/platforms/android/src/main/assets/app/tns_modules/application/application.android.js')
4444
assert not FileExists('TNS_App/platforms/android/src/main/assets/app/tns_modules/application/application.ios.js')
4545

46-
def test_201_Prepare_PlatformThatIsNotAdded(self):
47-
CreateProject(projName="TNS_App")
46+
def test_201_Prepare_Android_PlatformNotAdded(self):
47+
CreateProject(projName="TNS_App")
4848
output = runAUT(tnsPath + " prepare android --path TNS_App");
4949
assert("Copying template files..." in output)
5050
# Not valid for 1.3.0+
5151
# assert("Updated project.properties" in output)
5252
# assert("Updated local.properties" in output)
5353
assert("Project successfully created." in output)
5454
assert("Project successfully prepared" in output)
55+
assert FileExists('TNS_App/platforms/android/src/main/assets/app/tns_modules/application/application.js')
5556

5657
def test_300_Prepare_Android_RemoveOldFiles(self):
5758
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)
@@ -102,9 +103,3 @@ def test_401_Prepare_InvalidPlatform(self):
102103
CreateProject(projName="TNS_App")
103104
output = runAUT(tnsPath + " prepare windows --path TNS_App");
104105
assert("Invalid platform windows. Valid platforms are ios or android." in output)
105-
106-
@unittest.skip("Moved to test_201_Prepare_PlatformThatIsNotAdded - this is no more a negative case due to https://github.com/NativeScript/nativescript-cli/issues/785")
107-
def test_402_Prepare_PlatformThatIsNotAdded(self):
108-
CreateProject(projName="TNS_App")
109-
output = runAUT(tnsPath + " prepare android --path TNS_App");
110-
assert("The platform android is not added to this project. Please use 'tns platform add <platform>'" in output)

tests/prepare_osx.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import unittest
22

33
from helpers._os_lib import CleanupFolder, runAUT, FileExists
4-
from helpers._tns_lib import CreateProjectAndAddPlatform, iosRuntimeSymlinkPath, \
5-
tnsPath
4+
from helpers._tns_lib import CreateProject, CreateProjectAndAddPlatform, \
5+
iosRuntimeSymlinkPath, tnsPath
66

77

88
class Prepare_OSX(unittest.TestCase):
@@ -48,7 +48,15 @@ def test_200_Prepare_Additional_AppResources_iOS(self):
4848
# Verify XCode Project include files from App Resources folder
4949
output = runAUT("cat TNS_App/platforms/ios/TNSApp.xcodeproj/project.pbxproj | grep newDefault.png")
5050
assert ("newDefault.png" in output)
51-
51+
52+
def test_201_Prepare_iOS_PlatformNotAdded(self):
53+
CreateProject(projName="TNS_App")
54+
output = runAUT(tnsPath + " prepare ios --path TNS_App");
55+
assert("Copying template files..." in output)
56+
assert("Project successfully created." in output)
57+
assert("Project successfully prepared" in output)
58+
assert FileExists('TNS_App/platforms/ios/TNSApp/app/tns_modules/application/application.js')
59+
5260
def test_300_Prepare_iOS_PreserveCase(self):
5361
CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimeSymlinkPath, symlink=True)
5462
runAUT("cp TNS_App/node_modules/tns-core-modules/application/application-common.js TNS_App/node_modules/tns-core-modules/application/New-application-common.js")

0 commit comments

Comments
 (0)