-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlogtrace_tests.py
52 lines (40 loc) · 1.95 KB
/
logtrace_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""
Tests for --log trace option.
"""
from core.base_class.BaseClass import BaseClass
from core.osutils.folder import Folder
from core.settings.settings import CURRENT_OS, OSType
from core.tns.tns import Tns
class LogtraceTests(BaseClass):
@classmethod
def setUpClass(cls):
BaseClass.setUpClass(cls.__name__)
@classmethod
def tearDownClass(cls):
BaseClass.tearDownClass()
def setUp(self):
BaseClass.setUp(self)
Folder.cleanup(self.app_name)
self.app_id = "org.nativescript.{0}".format(self.app_name.replace("_", ""))
def test_101_create_project_log_trace(self):
output = Tns.create_app(self.app_name, log_trace=True, update_modules=False)
assert "Creating a new NativeScript project with name " + self.app_name in output
assert "and id org.nativescript.{0} at location".format(self.app_name.replace("_", "")) in output
if CURRENT_OS == OSType.WINDOWS:
assert 'spawn: npm.cmd "install"' in output
else:
assert 'spawn: npm "install"' in output
assert "Project " + self.app_name + " was successfully created" in output
def test_102_platform_add_log_trace(self):
Tns.create_app(self.app_name, update_modules=False)
# Disable tracking in Google Analytics https://github.com/NativeScript/nativescript-cli/issues/3536
Tns.run_tns_command("usage-reporting disable")
output = Tns.platform_add_android(attributes={"--path": self.app_name}, log_trace=True)
assert "Looking for project in" in output
assert "Project directory is" in output
assert "Package: " + self.app_id in output
assert "Installed Android Targets" in output
assert "Using Android SDK" in output
assert "Project successfully created" in output
# Check there is no any messages for tracking in Google Analytics
assert "Will send the following information to Google Analytics" not in output