File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed
Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -92,11 +92,12 @@ def checkCAsettings(args):
9292
9393
9494def checkForInvalidsettings (args ):
95- if not all (args .values ()):
95+ if all (args .values ()):
96+ return True , ''
97+ else :
9698 for key , value in args .items ():
9799 if value is None or value == '' :
98100 return False , MSG ['InvalidConfigParm' ].format (key )
99- else :
100101 return True , ''
101102
102103
Original file line number Diff line number Diff line change 11from source .confParser import (ConfigManager , merge_defaults_and_args ,
22 parse_cmd_args , checkCAsettings ,
33 checkApplicationPort ,
4- checkBasicAuthsettings )
4+ checkBasicAuthsettings ,
5+ checkForInvalidsettings )
56from source .__version__ import __version__ as version
67from nose2 .tools .decorators import with_setup
78
@@ -209,3 +210,18 @@ def test_case17():
209210 assert len (result .keys ()) > 0
210211 assert 'rawCounters' in result .keys ()
211212 assert result .get ('rawCounters' ) == eval ("False" )
213+
214+
215+ @with_setup (my_setup )
216+ def test_case18 ():
217+ if version > "8.0.9" :
218+ z = y .copy ()
219+ z ['apiKeyValue' ] = ''
220+ result = merge_defaults_and_args (y , r )
221+ result1 = merge_defaults_and_args (z , r )
222+ valid , msg = checkForInvalidsettings (result )
223+ valid1 , msg1 = checkForInvalidsettings (result1 )
224+ assert valid
225+ assert not valid1
226+ assert msg == ''
227+ assert len (msg1 ) > 1
Original file line number Diff line number Diff line change 44
55def test_case01 ():
66 result = os .system ('python ./source/zimonGrafanaIntf.py' )
7- assert result > 0
7+ print (result )
8+ assert result == 0
89
910
1011def test_case02 ():
1112 result = os .system ('python ./source/zimonGrafanaIntf.py -a 2' )
12- assert result > 0
13+ assert result == 0
1314
1415
1516def test_case03 ():
@@ -19,7 +20,7 @@ def test_case03():
1920
2021def test_case04 ():
2122 result = os .system ('python ./source/zimonGrafanaIntf.py -c 10 -m "/opt/registry/certs"' )
22- assert result > 0
23+ assert result == 0
2324
2425
2526def test_case05 ():
You can’t perform that action at this time.
0 commit comments