Skip to content

Commit

Permalink
Fix Test Failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasil Chimev authored and Vasil Chimev committed Aug 19, 2015
1 parent d7d0121 commit be2c763
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
5 changes: 2 additions & 3 deletions testdata/files/platform_ios_current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ NativeScript/lib/libNativeScript.a
TNSApp/build.xcconfig
TNSApp/en.lproj/InfoPlist.strings
TNSApp/en.lproj/LaunchScreen.xib
TNSApp/Images.xcassets/AppIcon.appiconset/Contents.json
TNSApp/Images.xcassets/LaunchImage.launchimage/Contents.json
TNSApp/main.m
TNSApp/strip-dynamic-framework-architectures.sh
TNSApp/TNSApp-Info.plist
TNSApp/TNSApp-Prefix.pch
TNSApp/TNSDebugging.h
TNSApp.xcodeproj/project.pbxproj
TNSApp.xcodeproj/project.pbxproj
4 changes: 2 additions & 2 deletions testdata/files/platform_ios_symlink.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
TNSApp/build.xcconfig
TNSApp/en.lproj/InfoPlist.strings
TNSApp/en.lproj/LaunchScreen.xib
TNSApp/Images.xcassets/AppIcon.appiconset/Contents.json
TNSApp/Images.xcassets/LaunchImage.launchimage/Contents.json
TNSApp/main.m
TNSApp/strip-dynamic-framework-architectures.sh
TNSApp/TNSApp-Info.plist
TNSApp/TNSApp-Prefix.pch
TNSApp/TNSDebugging.h
TNSApp.xcodeproj/project.pbxproj
19 changes: 14 additions & 5 deletions tests/platform_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_005_Platform_Add_Android_Symlink_And_FrameworkPath(self):
def test_200_Platform_List_InsideEmptyProject(self):
CreateProject(projName="TNS_App")
currentDir = os.getcwd()
os.chdir(os.path.join(currentDir,"TNS_App"))
os.chdir(os.path.join(currentDir, "TNS_App"))
output = runAUT(os.path.join("..", tnsPath) + " platform list")
os.chdir(currentDir);

Expand All @@ -103,7 +103,7 @@ def test_200_Platform_List_InsideEmptyProject(self):
def test_201_Platform_Add_Android_InsideProject(self):
CreateProject(projName="TNS_App")
currentDir = os.getcwd()
os.chdir(os.path.join(currentDir,"TNS_App"))
os.chdir(os.path.join(currentDir, "TNS_App"))
output = runAUT(os.path.join("..", tnsPath) + " platform add android")
os.chdir(currentDir);

Expand Down Expand Up @@ -215,7 +215,15 @@ def test_208_Platform_Downgrage_Android_FromLatestVersion(self):
assert ("\"version\": \"1.1.0\"" in output)
Build(platform="android", path="TNS_App")

def test_210_SetSDK(self):
def test_210_Platform_Update_MissingPlatform(self):
CreateProject(projName="TNS_App")
output = runAUT(tnsPath + " platform update android --path TNS_App")
assert("Copying template files..." in output)
assert("Updated project.properties" in output)
assert("Updated local.properties" in output)
assert("Project successfully created." in output)

def test_220_SetSDK(self):
CreateProject(projName="TNS_App")
output = PlatformAdd(platform="android --sdk 19", frameworkPath=androidRuntimePath, path="TNS_App")
assert("Copying template files..." in output)
Expand Down Expand Up @@ -282,7 +290,8 @@ def test_432_Platform_Remove_EmptyPlatform(self):
output = runAUT(tnsPath + " platform remove --path TNS_App")
assert ("No platform specified. Please specify a platform to remove" in output)
assert ("Usage" in output)


@unittest.skip("Moved to test_210_Platform_Update_MissingPlatform - this is no more a negative case due to https://github.com/NativeScript/nativescript-cli/issues/785")
def test_440_Platform_Update_MissingPlatform(self):
CreateProject(projName="TNS_App")
output = runAUT(tnsPath + " platform update android --path TNS_App")
Expand All @@ -304,4 +313,4 @@ def test_442_Platform_Update_EmptyPlatform(self):
def test_443_SetSDK_InvalidNewVersion(self):
CreateProject(projName="TNS_App")
output = PlatformAdd(platform="android --sdk 29", frameworkPath=androidRuntimePath, path="TNS_App", assertSuccess=False)
assert("You have selected to use android-29, but it is not currently installed." in output)
assert("You have selected to use android-29, but it is not currently installed." in output)
12 changes: 11 additions & 1 deletion tests/prepare_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ def test_200_Prepare_Android_InsideProject(self):
assert not FileExists('TNS_App/platforms/android/assets/app/tns_modules/application/application.android.js')
assert not FileExists('TNS_App/platforms/android/assets/app/tns_modules/application/application.ios.js')

def test_201_Prepare_PlatformThatIsNotAdded(self):
CreateProject(projName="TNS_App")
output = runAUT(tnsPath + " prepare android --path TNS_App");
assert("Copying template files..." in output)
assert("Updated project.properties" in output)
assert("Updated local.properties" in output)
assert("Project successfully created." in output)
assert("Project successfully prepared" in output)

def test_300_Prepare_Android_RemoveOldFiles(self):
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)
output = runAUT(tnsPath + " prepare android --path TNS_App")
Expand Down Expand Up @@ -92,7 +101,8 @@ def test_401_Prepare_InvalidPlatform(self):
CreateProject(projName="TNS_App")
output = runAUT(tnsPath + " prepare windows --path TNS_App");
assert("Invalid platform windows. Valid platforms are ios or android." in output)


@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")
def test_402_Prepare_PlatformThatIsNotAdded(self):
CreateProject(projName="TNS_App")
output = runAUT(tnsPath + " prepare android --path TNS_App");
Expand Down

0 comments on commit be2c763

Please sign in to comment.