Skip to content

Commit 632ef24

Browse files
Vasil ChimevVasil Chimev
Vasil Chimev
authored and
Vasil Chimev
committed
Add test_301_build_project_with_space().
NativeScript/NativeScript#1213
1 parent 692cd3b commit 632ef24

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

tests/build_linux.py

+32-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
'''
22
Tests for building projects with the Android platform
33
'''
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
712

813
from helpers._os_lib import cleanup_folder, remove, run_aut, file_exists
914
from helpers._tns_lib import TNS_PATH, create_project, create_project_add_platform, \
@@ -12,11 +17,6 @@
1217
ANDROID_RUNTIME_SYMLINK_PATH
1318

1419

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
2020
class BuildAndroid(unittest.TestCase):
2121

2222
@classmethod
@@ -25,6 +25,7 @@ def setUpClass(cls):
2525
remove("TNSApp-release.apk")
2626

2727
cleanup_folder('./tns-app')
28+
cleanup_folder('./TNS App')
2829
cleanup_folder('./TNS_App')
2930
cleanup_folder('./TNS_AppSymlink')
3031
create_project_add_platform(proj_name="TNS_App", \
@@ -51,6 +52,7 @@ def tearDownClass(cls):
5152
remove("TNSApp-release.apk")
5253

5354
cleanup_folder('./tns-app')
55+
cleanup_folder('./TNS App')
5456
cleanup_folder('./TNS_App')
5557
cleanup_folder('./TNS_AppSymlink')
5658

@@ -184,7 +186,28 @@ def test_301_build_project_with_dash(self):
184186
"cat tns-app/platforms/android/src/main/AndroidManifest.xml")
185187
assert "org.nativescript.tnsapp" in output
186188

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):
188211
# TODO: Find better way to skip tests on different OS
189212
# Skip on Windows, because tar is not available
190213
if 'Windows' not in platform.platform():

0 commit comments

Comments
 (0)