Skip to content

Commit cc7b65b

Browse files
Miroslava IvanovaMiroslava Ivanova
Miroslava Ivanova
authored and
Miroslava Ivanova
committed
refactoring
1 parent f1fdab1 commit cc7b65b

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

products/nativescript/tns_assert.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ def created(app_name, output=None, app_data=None):
3131
# Assert app data
3232
if app_data is not None:
3333
# Assert app type
34-
assert File.exists(os.path.join(app_path, 'node_modules', 'tns-core-modules', 'package.json'))
35-
assert File.exists(os.path.join(app_path, 'node_modules', 'tns-core-modules', 'LICENSE'))
36-
assert File.exists(os.path.join(app_path, 'node_modules', 'tns-core-modules', 'xml', 'xml.js'))
37-
assert Folder.exists(os.path.join(app_path, 'node_modules', 'nativescript-theme-core'))
38-
assert Folder.exists(os.path.join(app_path, 'node_modules', 'nativescript-dev-webpack'))
34+
assert Folder.exists(os.path.join(app_path, TnsAssert.TNS_MODULES))
35+
assert Folder.exists(os.path.join(app_path, TnsAssert.TNS_MODULES))
36+
assert Folder.exists(os.path.join(app_path, TnsAssert.TNS_MODULES))
37+
assert Folder.exists(os.path.join(app_path, TnsAssert.NODE_MODULES, 'nativescript-theme-core'))
38+
assert Folder.exists(os.path.join(app_path, TnsAssert.NODE_MODULES, 'nativescript-dev-webpack'))
3939

4040
if app_data.type is AppType.JS:
4141
pass
@@ -44,18 +44,22 @@ def created(app_name, output=None, app_data=None):
4444
assert File.exists(os.path.join(app_path, 'webpack.config.js'))
4545
assert File.exists(os.path.join(app_path, 'tsconfig.tns.json'))
4646
assert not File.exists(os.path.join(app_path, 'references.d.ts'))
47-
assert File.exists(os.path.join(app_path, 'node_modules', 'tns-core-modules', 'tns-core-modules.d.ts'))
48-
assert File.exists(os.path.join(app_path, TnsAssert.HOOKS, 'before-prepare', 'nativescript-dev-typescript.js'))
49-
assert File.exists(os.path.join(app_path, TnsAssert.HOOKS, 'before-watch', 'nativescript-dev-typescript.js'))
47+
assert File.exists(os.path.join(app_path, TnsAssert.TNS_MODULES, 'tns-core-modules.d.ts'))
48+
assert File.exists(os.path.join(app_path, TnsAssert.HOOKS, 'before-prepare',
49+
'nativescript-dev-typescript.js'))
50+
assert File.exists(os.path.join(app_path, TnsAssert.HOOKS, 'before-watch',
51+
'nativescript-dev-typescript.js'))
5052
pass
5153
elif app_data.type is AppType.NG:
5254
assert File.exists(os.path.join(app_path, 'tsconfig.json'))
5355
assert File.exists(os.path.join(app_path, 'webpack.config.js'))
5456
assert File.exists(os.path.join(app_path, 'tsconfig.tns.json'))
5557
assert not File.exists(os.path.join(app_path, 'references.d.ts'))
56-
assert File.exists(os.path.join(app_path, 'node_modules', 'tns-core-modules', 'tns-core-modules.d.ts'))
57-
assert File.exists(os.path.join(app_path, TnsAssert.HOOKS, 'before-prepare', 'nativescript-dev-typescript.js'))
58-
assert File.exists(os.path.join(app_path, TnsAssert.HOOKS, 'before-watch', 'nativescript-dev-typescript.js'))
58+
assert File.exists(os.path.join(app_path, TnsAssert.TNS_MODULES, 'tns-core-modules.d.ts'))
59+
assert File.exists(os.path.join(app_path, TnsAssert.HOOKS, 'before-prepare',
60+
'nativescript-dev-typescript.js'))
61+
assert File.exists(os.path.join(app_path, TnsAssert.HOOKS, 'before-watch',
62+
'nativescript-dev-typescript.js'))
5963
pass
6064
elif app_data.type is AppType.VUE:
6165
pass

tests/cli/create/create_tests.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class CreateTests(TnsTest):
2727
ng_source_project_dir = os.path.join(Settings.TEST_RUN_HOME, ng_app)
2828
ng_target_project_dir = os.path.join(Settings.TEST_RUN_HOME, 'data', 'temp', ng_app)
2929

30+
js_app_space = Settings.AppName.WITH_SPACE
31+
3032
@classmethod
3133
def setUpClass(cls):
3234
TnsTest.setUpClass()
@@ -40,8 +42,19 @@ def tearDownClass(cls):
4042

4143
def test_001_create_app_like_real_user(self):
4244
Tns.create(app_name=self.js_app, app_data=None)
43-
44-
def test_002_create_apps(self):
45+
s
46+
def test_002_create_app_template_js(self):
4547
Tns.create(app_name=self.js_app, template=Template.HELLO_WORLD_JS.local_package, app_data=self.app_data_JS)
48+
49+
def test_003_create_app_template_ts(self):
4650
Tns.create(app_name=self.ts_app, template=Template.HELLO_WORLD_TS.local_package, app_data=self.app_data_TS)
51+
52+
def test_004_create_app_template_ng(self):
4753
Tns.create(app_name=self.ng_app, template=Template.HELLO_WORLD_NG.local_package, app_data=self.app_data_NG)
54+
55+
def test_005_create_project_with_path(self):
56+
"""Create project with --path option"""
57+
58+
def test_006_create_project_with_space(self):
59+
""" Create project with space is possible, but packageId will skip the space symbol"""
60+
Tns.create(app_name=self.js_app_space, template=Template.HELLO_WORLD_JS.local_package, app_data=self.app_data_JS)

0 commit comments

Comments
 (0)