1
- '''
1
+ """
2
2
Verifications for NativeScript projects.
3
- '''
3
+ """
4
4
import json
5
5
import os
6
6
import re
@@ -67,12 +67,12 @@ def _get_ios_modules_path(app_name):
67
67
68
68
@staticmethod
69
69
def created (app_name , output = None , full_check = True ):
70
- '''
70
+ """
71
71
Assert application is created properly.
72
72
:param app_name: App name
73
73
:param output: Outout of `tns create command`
74
74
:param full_check: If true everything will be checked. If false only console output will be checked.
75
- '''
75
+ """
76
76
77
77
# Assert console output is ok
78
78
if output is not None :
@@ -97,11 +97,11 @@ def created(app_name, output=None, full_check=True):
97
97
98
98
@staticmethod
99
99
def created_ts (app_name , output = None ):
100
- '''
100
+ """
101
101
Assert TypeScript application is created properly.
102
102
:param app_name: App name
103
103
:param output: Outout of `tns create command`
104
- '''
104
+ """
105
105
106
106
# First make sure base app is created
107
107
TnsAsserts .created (app_name = app_name , output = output )
@@ -139,12 +139,12 @@ def created_ts(app_name, output=None):
139
139
140
140
@staticmethod
141
141
def platform_added (app_name , platform = Platforms .NONE , output = None ):
142
- '''
142
+ """
143
143
Assert platform is added.
144
144
:param app_name: Application name (folder where app is located).
145
145
:param platform: Platforms that should be available.
146
146
:param output: output of `tns platform add` command
147
- '''
147
+ """
148
148
149
149
# Verify console output is correct
150
150
if output is not None :
@@ -173,12 +173,12 @@ def platform_added(app_name, platform=Platforms.NONE, output=None):
173
173
174
174
@staticmethod
175
175
def platform_list_status (output = None , prepared = Platforms .NONE , added = Platforms .NONE ):
176
- '''
176
+ """
177
177
Assert platform list status
178
178
:param output: Outout of `tns platform list` command
179
179
:param prepared: Prepared platform.
180
180
:param added: Added platform.
181
- '''
181
+ """
182
182
if output is not None :
183
183
# Assert prepare status
184
184
if prepared is Platforms .NONE :
@@ -246,13 +246,13 @@ def get_tsconfig_json(app_name):
246
246
247
247
@staticmethod
248
248
def prepared (app_name , platform = Platforms .BOTH , output = None , prepare_type = Prepare .FULL ):
249
- '''
249
+ """
250
250
Assert project is prepared properly.
251
251
:param app_name: Application name.
252
252
:param platform: Platform that should be prepared.
253
253
:param output: Output of `tns prepare` platform.
254
254
:param prepare_type: Prepare type (SKIP, INCREMENTAL, FULL, FIRST_TIME)
255
- '''
255
+ """
256
256
257
257
def _incremental_prepare ():
258
258
assert 'Skipping prepare.' not in output
@@ -292,28 +292,26 @@ def _full_prepare():
292
292
if platform is Platforms .IOS or platform is Platforms .BOTH :
293
293
assert 'tns-ios' in output
294
294
295
- # Ignore because of https://github.com/NativeScript/nativescript-cli/issues/2586
296
- # if platform is Platforms.ANDROID or platform is Platforms.BOTH:
297
- # app_path = app_name + TnsAsserts.PLATFORM_ANDROID_APP_PATH
298
- # modules_path = app_name + TnsAsserts.PLATFORM_ANDROID_TNS_MODULES_PATH
299
- # assert File.exists(app_path + 'main-view-model.js'), \
300
- # 'Application files does not exists in platforms folder.'
301
- # assert File.exists(modules_path + 'application/application.js'), \
302
- # 'Modules does not exists in platforms folder.'
303
- # assert File.exists(modules_path + 'xml/xml.js'), 'TNS Modules does not exists in platforms folder.'
304
- # assert not File.exists(modules_path + 'application/application.android.js'), \
305
- # 'Prepare does not strip \'android\' from name of js files.'
306
- # assert not File.exists(modules_path + 'application/application.ios.js'), \
307
- # 'Prepare does not skip \'ios\' specific js files.'
308
- #
309
- # if platform is Platforms.IOS or platform is Platforms.BOTH:
310
- # app_path = TnsAsserts._get_ios_app_path(app_name)
311
- # modules_path = TnsAsserts._get_ios_modules_path(app_name)
312
- # assert File.exists(app_path + 'main-view-model.js'), \
313
- # 'Application files does not exists in platforms folder.'
314
- # assert File.exists(modules_path + 'application/application.js'), \
315
- # 'Modules does not exists in platforms folder.'
316
- # assert not File.exists(modules_path + 'application/application.android.js'), \
317
- # 'Prepare does not skip \'ios\' specific js files.'
318
- # assert not File.exists(modules_path + 'application/application.ios.js'), \
319
- # 'Prepare does not strip \'ios\' from name of js files.'
295
+ if platform is Platforms .ANDROID or platform is Platforms .BOTH :
296
+ app_path = app_name + TnsAsserts .PLATFORM_ANDROID_APP_PATH
297
+ modules_path = app_name + TnsAsserts .PLATFORM_ANDROID_TNS_MODULES_PATH
298
+ assert File .exists (app_path + 'main-view-model.js' ), \
299
+ 'Application files does not exists in platforms folder.'
300
+ assert File .exists (modules_path + 'application/application.js' ), \
301
+ 'Modules does not exists in platforms folder.'
302
+ assert File .exists (modules_path + 'xml/xml.js' ), 'TNS Modules does not exists in platforms folder.'
303
+ assert not File .exists (modules_path + 'application/application.android.js' ), \
304
+ 'Prepare does not strip \' android\' from name of js files.'
305
+ assert not File .exists (modules_path + 'application/application.ios.js' ), \
306
+ 'Prepare does not skip \' ios\' specific js files.'
307
+ if platform is Platforms .IOS or platform is Platforms .BOTH :
308
+ app_path = TnsAsserts ._get_ios_app_path (app_name )
309
+ modules_path = TnsAsserts ._get_ios_modules_path (app_name )
310
+ assert File .exists (app_path + 'main-view-model.js' ), \
311
+ 'Application files does not exists in platforms folder.'
312
+ assert File .exists (modules_path + 'application/application.js' ), \
313
+ 'Modules does not exists in platforms folder.'
314
+ assert not File .exists (modules_path + 'application/application.android.js' ), \
315
+ 'Prepare does not skip \' ios\' specific js files.'
316
+ assert not File .exists (modules_path + 'application/application.ios.js' ), \
317
+ 'Prepare does not strip \' ios\' from name of js files.'
0 commit comments