Skip to content

Commit 2291f72

Browse files
author
Dimitar Topuzov
committed
Run skipped tests again
1 parent b2b0797 commit 2291f72

File tree

5 files changed

+37
-54
lines changed

5 files changed

+37
-54
lines changed

core/tns/tns_verifications.py

+35-37
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
'''
1+
"""
22
Verifications for NativeScript projects.
3-
'''
3+
"""
44
import json
55
import os
66
import re
@@ -67,12 +67,12 @@ def _get_ios_modules_path(app_name):
6767

6868
@staticmethod
6969
def created(app_name, output=None, full_check=True):
70-
'''
70+
"""
7171
Assert application is created properly.
7272
:param app_name: App name
7373
:param output: Outout of `tns create command`
7474
:param full_check: If true everything will be checked. If false only console output will be checked.
75-
'''
75+
"""
7676

7777
# Assert console output is ok
7878
if output is not None:
@@ -97,11 +97,11 @@ def created(app_name, output=None, full_check=True):
9797

9898
@staticmethod
9999
def created_ts(app_name, output=None):
100-
'''
100+
"""
101101
Assert TypeScript application is created properly.
102102
:param app_name: App name
103103
:param output: Outout of `tns create command`
104-
'''
104+
"""
105105

106106
# First make sure base app is created
107107
TnsAsserts.created(app_name=app_name, output=output)
@@ -139,12 +139,12 @@ def created_ts(app_name, output=None):
139139

140140
@staticmethod
141141
def platform_added(app_name, platform=Platforms.NONE, output=None):
142-
'''
142+
"""
143143
Assert platform is added.
144144
:param app_name: Application name (folder where app is located).
145145
:param platform: Platforms that should be available.
146146
:param output: output of `tns platform add` command
147-
'''
147+
"""
148148

149149
# Verify console output is correct
150150
if output is not None:
@@ -173,12 +173,12 @@ def platform_added(app_name, platform=Platforms.NONE, output=None):
173173

174174
@staticmethod
175175
def platform_list_status(output=None, prepared=Platforms.NONE, added=Platforms.NONE):
176-
'''
176+
"""
177177
Assert platform list status
178178
:param output: Outout of `tns platform list` command
179179
:param prepared: Prepared platform.
180180
:param added: Added platform.
181-
'''
181+
"""
182182
if output is not None:
183183
# Assert prepare status
184184
if prepared is Platforms.NONE:
@@ -246,13 +246,13 @@ def get_tsconfig_json(app_name):
246246

247247
@staticmethod
248248
def prepared(app_name, platform=Platforms.BOTH, output=None, prepare_type=Prepare.FULL):
249-
'''
249+
"""
250250
Assert project is prepared properly.
251251
:param app_name: Application name.
252252
:param platform: Platform that should be prepared.
253253
:param output: Output of `tns prepare` platform.
254254
:param prepare_type: Prepare type (SKIP, INCREMENTAL, FULL, FIRST_TIME)
255-
'''
255+
"""
256256

257257
def _incremental_prepare():
258258
assert 'Skipping prepare.' not in output
@@ -292,28 +292,26 @@ def _full_prepare():
292292
if platform is Platforms.IOS or platform is Platforms.BOTH:
293293
assert 'tns-ios' in output
294294

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.'

tests/build/PlatformAndroid_Tests.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Test platform add (android)
33
"""
44
import os
5-
import unittest
65

76
from core.base_class.BaseClass import BaseClass
87
from core.osutils.file import File
@@ -72,7 +71,6 @@ def test_210_platform_update_android_when_platform_not_added(self):
7271
assert_success=False)
7372
TnsAsserts.platform_added(self.app_name, platform=Platforms.ANDROID, output=output)
7473

75-
@unittest.skip("Ignored because of https://github.com/NativeScript/nativescript-cli/issues/2588")
7674
def test_300_set_sdk(self):
7775
"""Platform add android should be able to specify target sdk with `--sdk` option"""
7876
Tns.create_app(self.app_name, update_modules=False)
@@ -83,7 +81,6 @@ def test_300_set_sdk(self):
8381
assert "android:minSdkVersion=\"17\"" in output
8482
assert "android:targetSdkVersion=\"19\"" in output
8583

86-
@unittest.skip("Ignored because of https://github.com/NativeScript/nativescript-cli/issues/2588")
8784
def test_310_set_sdk_not_installed(self):
8885
Tns.create_app(self.app_name, update_modules=False)
8986
output = Tns.platform_add_android(attributes={"--path": self.app_name,
@@ -148,7 +145,6 @@ def test_421_platform_add_android_wrong_option(self):
148145
assert no_platform in output
149146
assert "Usage" in output
150147

151-
@unittest.skip("Ignored because of https://github.com/NativeScript/nativescript-cli/issues/2587")
152148
def test_430_platform_remove_missing_invalid_or_empty_platform(self):
153149
Tns.create_app(self.app_name, update_modules=False)
154150

tests/build/PrepareAndroid_Tests.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44
import os
55
import time
6-
import unittest
76

87
from core.base_class.BaseClass import BaseClass
98
from core.osutils.command import run
@@ -135,7 +134,6 @@ def test_310_prepare_should_flatten_scoped_dependencies(self):
135134
ng_path_in_platforms_folder = self.app_name + TnsAsserts.PLATFORM_ANDROID_NPM_MODULES_PATH + '@angular/core'
136135
assert File.exists(ng_path_in_platforms_folder), "Scoped dependencies are flattened, please see #1783!"
137136

138-
@unittest.skip("Ignored because of https://github.com/NativeScript/nativescript-cli/issues/2587")
139137
def test_400_prepare_missing_or_missing_platform(self):
140138
Tns.create_app(self.app_name, update_modules=False)
141139

tests/run/emulator/EmulateAndroidTests.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,14 @@
33
"""
44
import os
55

6-
# C0103 - Invalid %s name "%s"
7-
# C0111 - Missing docstring
8-
# R0201 - Method could be a function
9-
# R0904 - Too many public methods
10-
# pylint: disable=C0103, C0111, R0201, R0904
11-
import unittest
12-
136
from core.base_class.BaseClass import BaseClass
147
from core.device.device import Device
158
from core.device.emulator import Emulator
169
from core.osutils.folder import Folder
1710
from core.settings.settings import ANDROID_RUNTIME_PATH, TNS_PATH, ANDROID_KEYSTORE_PATH, ANDROID_KEYSTORE_PASS, \
1811
ANDROID_KEYSTORE_ALIAS, ANDROID_KEYSTORE_ALIAS_PASS, EMULATOR_ID
19-
from core.tns.tns import Tns
2012
from core.settings.strings import *
13+
from core.tns.tns import Tns
2114

2215

2316
class EmulateAndroidTests(BaseClass):
@@ -66,7 +59,6 @@ def test_001_emulate_android_in_running_emulator(self):
6659
Device.is_running(app_id="org.nativescript.TNSApp", device_id=EMULATOR_ID), \
6760
"Application is not running on {0}".format(EMULATOR_ID)
6861

69-
@unittest.skip("Ignored because of https://github.com/NativeScript/nativescript-cli/issues/2589")
7062
def test_002_emulate_android_release(self):
7163
output = Tns.run_tns_command("emulate android", attributes={ # "--device": EMULATOR_NAME,
7264
"--keyStorePath": ANDROID_KEYSTORE_PATH,
@@ -95,7 +87,7 @@ def test_200_emulate_android_inside_project(self):
9587
},
9688
tns_path=os.path.join("..", TNS_PATH), timeout=660)
9789
os.chdir(current_dir)
98-
# assert successfully_prepared in output (remove the comment after test_002_emulate_android_release is enabled)
90+
assert successfully_prepared in output
9991
assert successfully_built in output
10092
assert "Starting Android emulator with image" not in output
10193
assert installed_on_device.format(EMULATOR_ID) in output

tests/run/emulator/RunAndroidTests.py

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from core.tns.tns import Tns
1818

1919

20-
@unittest.skip("Ignored because of https://github.com/NativeScript/nativescript-cli/issues/2590")
2120
class RunAndroidTests(BaseClass):
2221
@classmethod
2322
def setUpClass(cls):

0 commit comments

Comments
 (0)