Skip to content

Commit e4111b4

Browse files
committed
fix: unit tests
1 parent 486f5f7 commit e4111b4

File tree

2 files changed

+10
-21
lines changed

2 files changed

+10
-21
lines changed

core_tests/unit/product/test_preview_helpers.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

core_tests/unit/product/sync_tests.py renamed to core_tests/unit/product/tns_helpers_tests.py

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

44
from core.enums.platform_type import Platform
55
from core.settings import Settings
6+
from core.utils.file_utils import File
67
from data.changes import Changes
8+
from products.nativescript.preview_helpers import Preview
79
from products.nativescript.run_type import RunType
810
from products.nativescript.tns_logs import TnsLogs
911

1012

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

1416
def test_01_constants(self):
1517
assert len(TnsLogs.SKIP_NODE_MODULES) == 2
@@ -158,6 +160,13 @@ def test_18_get_run_messages_incremental_prepare(self):
158160
assert 'Skipping prepare.' not in logs
159161
assert 'Successfully transferred main-view-model.js' in logs
160162

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+
161170

162171
if __name__ == '__main__':
163172
unittest.main()

0 commit comments

Comments
 (0)