1
1
"""
2
2
Test for usage-reporting command
3
3
"""
4
+ import os
4
5
5
6
from core .base_class .BaseClass import BaseClass
6
7
from core .settings .strings import *
@@ -21,13 +22,29 @@ def test_001_usage_reporting_enable(self):
21
22
output = Tns .run_tns_command ("usage-reporting enable" )
22
23
assert enabled .format (usage_reporting , "now " ) in output
23
24
25
+ # Check there is message for tracking in Google Analytics
26
+ output = Tns .run_tns_command ("doctor" , timeout = 180 , log_trace = True )
27
+ assert "Will send the following information to Google Analytics" in output
28
+
24
29
output = Tns .run_tns_command ("usage-reporting status" )
25
30
assert enabled .format (usage_reporting , "" ) in output
26
31
32
+ # https://github.com/NativeScript/nativescript-cli/issues/3595
33
+ output = Tns .create_app (self .app_name ,
34
+ attributes = {'--template' : os .path .join ('data' , 'apps' , 'livesync-hello-world.tgz' )},
35
+ log_trace = True ,
36
+ force_clean = False , update_modules = True )
37
+ assert "label: 'data/apps/livesync-hello-world.tgz'" not in output
38
+ assert "label: 'localTemplate_tns-template-hello-world'" in output
39
+
27
40
def test_002_usage_reporting_disable (self ):
28
41
output = Tns .run_tns_command ("usage-reporting disable" )
29
42
assert disabled .format (usage_reporting , "now " ) in output
30
43
44
+ # Check there is no any message for tracking in Google Analytics
45
+ output = Tns .run_tns_command ("doctor" , timeout = 180 , log_trace = True )
46
+ assert "Will send the following information to Google Analytics" not in output
47
+
31
48
output = Tns .run_tns_command ("usage-reporting status" )
32
49
assert disabled .format (usage_reporting , "" ) in output
33
50
0 commit comments