Skip to content

Commit

Permalink
Update Library Tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasil Chimev authored and Vasil Chimev committed Aug 20, 2015
1 parent a376000 commit e72e97d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
23 changes: 10 additions & 13 deletions tests/library_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,27 @@

from helpers._os_lib import CleanupFolder, CheckFilesExists, CheckOutput, runAUT, \
FileExists, FolderExists
from helpers._tns_lib import tnsPath, Build, CreateProject, PlatformAdd, LibraryAdd

from helpers._tns_lib import androidRuntimePath, tnsPath, \
Build, CreateProject, PlatformAdd, LibraryAdd

class Library_Linux(unittest.TestCase):

def setUp(self):

print ""
print "#####"
print self.id()
print "#####"
print ""

CleanupFolder('./TNS App');

CleanupFolder('./TNS_App');
CleanupFolder('./folder');
CleanupFolder('./template');

def tearDown(self):
def tearDown(self):
pass

def test_001_Library_Add_Android_JarLib(self):
CreateProject(projName="TNS_App")
PlatformAdd(platform="android", path="TNS_App")
PlatformAdd(platform="android", frameworkPath=androidRuntimePath, path="TNS_App")

LibraryAdd(platform="android", libPath="QA-TestApps/external-lib", path="TNS_App")
assert (CheckFilesExists("TNS_App", "library_add_JarLib_1.1.0.txt"))
Expand All @@ -35,7 +32,7 @@ def test_001_Library_Add_Android_JarLib(self):

def test_002_Library_Add_Android_ProjLib(self):
CreateProject(projName="TNS_App", copyFrom="QA-TestApps/external-lib/external-lib-android")
PlatformAdd(platform="android", path="TNS_App")
PlatformAdd(platform="android", frameworkPath=androidRuntimePath, path="TNS_App")

LibraryAdd(platform="android", libPath="QA-TestApps/external-lib/AndroidAppProject", path="TNS_App")
assert (CheckFilesExists("TNS_App", "library_add_ProjLib_1.1.0.txt"))
Expand All @@ -59,7 +56,7 @@ def test_301_Library(self):

def test_401_Library_Add_Android_NoLib(self):
CreateProject(projName="TNS_App", copyFrom="QA-TestApps/external-lib/external-lib-android")
PlatformAdd(platform="android", path="TNS_App")
PlatformAdd(platform="android", frameworkPath=androidRuntimePath, path="TNS_App")
output = LibraryAdd(platform="android", libPath="QA-TestApps/external-lib/external-lib-android", path="TNS_App", assertSuccess=False)
assert ("Invalid library path" in output)
assert not FolderExists("TNS_App/lib/Android")
Expand All @@ -69,4 +66,4 @@ def test_402_Library_Add_NoPlatform(self):
output = runAUT(tnsPath + " library add android QA-TestApps/ --path TNS_App")

assert ("The platform android is not added to this project. Please use 'tns platform add <platform>'" in output)
assert not FileExists("TNS_App/lib/Android/java-project.jar")
assert not FileExists("TNS_App/lib/Android/java-project.jar")
15 changes: 8 additions & 7 deletions tests/library_osx.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import unittest

from helpers._os_lib import CleanupFolder, CheckFilesExists, FolderExists, runAUT
from helpers._tns_lib import Build, CreateProject, PlatformAdd, LibraryAdd
from helpers._tns_lib import iosRuntimePath, \
Build, CreateProject, PlatformAdd, LibraryAdd

class Library_OSX(unittest.TestCase):

Expand All @@ -12,15 +13,15 @@ def setUp(self):
print self.id()
print "#####"
print ""

CleanupFolder('./TNS_App');

def tearDown(self):
pass

def test_001_Library_Add_iOS_Framework(self):
CreateProject(projName="TNS_App")
PlatformAdd(platform="ios", path="TNS_App")
PlatformAdd(platform="ios", frameworkPath=iosRuntimePath, path="TNS_App")

LibraryAdd(platform="ios", libPath="QA-TestApps/external-lib/TelerikUI.framework", path="TNS_App")
assert (CheckFilesExists("TNS_App/lib/iOS/TelerikUI.framework", "library_add_Framework_1.1.0.txt"))
Expand All @@ -33,9 +34,9 @@ def test_001_Library_Add_iOS_Framework(self):
assert not ("TNS_App/lib/iOS/TelerikUI.framework" in output)

def test_401_Library_Add_iOS_NoLib(self):
CreateProject(projName="TNS_App")
PlatformAdd(platform="ios", path="TNS_App")
CreateProject(projName="TNS_App")
PlatformAdd(platform="ios", frameworkPath=iosRuntimePath, path="TNS_App")

output = LibraryAdd(platform="ios", libPath="TelerikUI.framework", path="TNS_App", assertSuccess=False)
assert (".framework does not exist" in output)
assert not FolderExists("TNS_App/lib")
assert not FolderExists("TNS_App/lib")

0 comments on commit e72e97d

Please sign in to comment.