Skip to content

Commit a4f5eeb

Browse files
committed
fix: unit tests
1 parent e4111b4 commit a4f5eeb

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ install:
1010
- python -m pip install --upgrade pip
1111
- pip install --upgrade -r requirements.txt
1212
script:
13+
- export ANDROID_HOME=$HOME
1314
- python -m nose core_tests/unit
1415
- python -m flake8 --max-line-length=120 core core_tests data products tests
1516
- python -m pylint --disable=locally-disabled --rcfile=.pylintrc core data products
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import os
2+
import unittest
3+
4+
from core.utils.file_utils import File
5+
from products.nativescript.preview_helpers import Preview
6+
7+
8+
# noinspection PyMethodMayBeStatic
9+
class PreviewHelperTests(unittest.TestCase):
10+
current_folder = os.path.dirname(os.path.realpath(__file__))
11+
12+
def test_01_constants(self):
13+
text = File.read(path=os.path.join(self.current_folder, 'preview.log'))
14+
url = Preview.get_url(output=text)
15+
assert 'nsplay://boot\\?instanceId=' in url
16+
17+
18+
if __name__ == '__main__':
19+
unittest.main()

core_tests/unit/product/tns_helpers_tests.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33

44
from core.enums.platform_type import Platform
55
from core.settings import Settings
6-
from core.utils.file_utils import File
76
from data.changes import Changes
8-
from products.nativescript.preview_helpers import Preview
97
from products.nativescript.run_type import RunType
108
from products.nativescript.tns_logs import TnsLogs
119

1210

1311
# noinspection PyMethodMayBeStatic
14-
class TnsHelpersTests(unittest.TestCase):
12+
class SyncMessagesTests(unittest.TestCase):
1513

1614
def test_01_constants(self):
1715
assert len(TnsLogs.SKIP_NODE_MODULES) == 2
@@ -160,13 +158,6 @@ def test_18_get_run_messages_incremental_prepare(self):
160158
assert 'Skipping prepare.' not in logs
161159
assert 'Successfully transferred main-view-model.js' in logs
162160

163-
@unittest.skipIf(os.environ.get('TRAVIS', None) is not None, 'Skip on Travis.')
164-
def test_40_get_preview_url(self):
165-
current_folder = os.path.dirname(os.path.realpath(__file__))
166-
text = File.read(path=os.path.join(current_folder, 'preview.log'))
167-
url = Preview.get_url(output=text)
168-
assert 'nsplay://boot\\?instanceId=' in url
169-
170161

171162
if __name__ == '__main__':
172163
unittest.main()

0 commit comments

Comments
 (0)