1
1
'''
2
2
Tests for building projects with the Android platform
3
3
'''
4
- import os
5
- import platform
6
- import unittest
4
+
5
+ # C0103 - Invalid %s name "%s"
6
+ # C0111 - Missing docstring
7
+ # R0201 - Method could be a function
8
+ # R0904 - Too many public methods
9
+ # pylint: disable=C0103, C0111, R0201, R0904
10
+
11
+ import os , platform , unittest
7
12
8
13
from helpers ._os_lib import cleanup_folder , remove , run_aut , file_exists
9
14
from helpers ._tns_lib import TNS_PATH , create_project , create_project_add_platform , \
12
17
ANDROID_RUNTIME_SYMLINK_PATH
13
18
14
19
15
- # C0103 - Invalid %s name "%s"
16
- # C0111 - Missing docstring
17
- # R0201 - Method could be a function
18
- # R0904 - Too many public methods
19
- # pylint: disable=C0103, C0111, R0201, R0904
20
20
class BuildAndroid (unittest .TestCase ):
21
21
22
22
@classmethod
@@ -25,6 +25,7 @@ def setUpClass(cls):
25
25
remove ("TNSApp-release.apk" )
26
26
27
27
cleanup_folder ('./tns-app' )
28
+ cleanup_folder ('./TNS App' )
28
29
cleanup_folder ('./TNS_App' )
29
30
cleanup_folder ('./TNS_AppSymlink' )
30
31
create_project_add_platform (proj_name = "TNS_App" , \
@@ -51,6 +52,7 @@ def tearDownClass(cls):
51
52
remove ("TNSApp-release.apk" )
52
53
53
54
cleanup_folder ('./tns-app' )
55
+ cleanup_folder ('./TNS App' )
54
56
cleanup_folder ('./TNS_App' )
55
57
cleanup_folder ('./TNS_AppSymlink' )
56
58
@@ -184,7 +186,28 @@ def test_301_build_project_with_dash(self):
184
186
"cat tns-app/platforms/android/src/main/AndroidManifest.xml" )
185
187
assert "org.nativescript.tnsapp" in output
186
188
187
- def test_302_build_project_with_gz_file (self ):
189
+ def test_301_build_project_with_space (self ):
190
+ create_project_add_platform (proj_name = "\" TNS App\" " ,
191
+ platform = "android" , framework_path = ANDROID_RUNTIME_PATH )
192
+
193
+ # Verify project build
194
+ output = run_aut (TNS_PATH + " build android --path \" TNS App\" " )
195
+ assert "Project successfully prepared" in output
196
+ assert "BUILD SUCCESSFUL" in output
197
+ assert "Project successfully built" in output
198
+ assert file_exists (
199
+ "TNS App/platforms/android/build/outputs/apk/TNSApp-debug.apk" )
200
+
201
+ # Verify project id
202
+ output = run_aut ("cat TNS\\ App/package.json" )
203
+ assert "org.nativescript.TNSApp" in output
204
+
205
+ # Verify AndroidManifest.xml
206
+ output = run_aut (
207
+ "cat TNS\\ App/platforms/android/src/main/AndroidManifest.xml" )
208
+ assert "org.nativescript.TNSApp" in output
209
+
210
+ def test_303_build_project_with_gz_file (self ):
188
211
# TODO: Find better way to skip tests on different OS
189
212
# Skip on Windows, because tar is not available
190
213
if 'Windows' not in platform .platform ():
0 commit comments