44from source .bridgeLogger import configureLogging
55from nose2 .tools .such import helper as assert_helper
66from nose2 .tools .decorators import with_setup
7- from argparse import Namespace
8-
97
108
119def my_setup ():
@@ -16,35 +14,37 @@ def my_setup():
1614 wrongSensorsConfig = 'ZIMonSensors-protocols-wrong.cfg'
1715 sensorsCount = 0
1816
17+
1918@with_setup (my_setup )
2019def test_case01 ():
2120 with assert_helper .assertRaises (OSError ):
22- sensorsList = readSensorsConfig (logger )
21+ readSensorsConfig (logger )
22+
2323
2424@with_setup (my_setup )
2525def test_case02 ():
2626 zimonFile = os .path .join (path , "tests" , "test_data" , mainSensorsConfig )
2727 sensorsList = readSensorsConfig (logger , zimonFile )
28- assert isinstance (sensorsList , list )
28+ assert isinstance (sensorsList , list )
2929 assert len (sensorsList ) > 0
3030
31+
3132@with_setup (my_setup )
3233def test_case03 ():
3334 zimonFile = os .path .join (path , "tests" , "test_data" , wrongSensorsConfig )
3435 sensorsList = readSensorsConfig (logger , zimonFile )
35- assert isinstance (sensorsList , list )
36+ assert isinstance (sensorsList , list )
3637 assert len (sensorsList ) > 0
3738
39+
3840@with_setup (my_setup )
3941def test_case04 ():
4042 zimonFile = os .path .join (path , "tests" , "test_data" , mainSensorsConfig )
4143 sensorsList = readSensorsConfig (logger , zimonFile )
4244 sensorsCount = len (sensorsList )
45+ assert sensorsCount == 32
4346
4447 zimonFile = os .path .join (path , "tests" , "test_data" )
45- print (zimonFile )
4648 sensorsList1 = readSensorsConfig (logger , zimonFile )
47- print (len (sensorsList1 ))
48- assert isinstance (sensorsList1 , list )
49- assert len (sensorsList1 ) > sensorsCount
50-
49+ assert isinstance (sensorsList1 , list )
50+ assert len (sensorsList1 ) > len (sensorsList )
0 commit comments