4
4
from source .bridgeLogger import configureLogging
5
5
from nose2 .tools .such import helper as assert_helper
6
6
from nose2 .tools .decorators import with_setup
7
- from argparse import Namespace
8
-
9
7
10
8
11
9
def my_setup ():
@@ -16,35 +14,37 @@ def my_setup():
16
14
wrongSensorsConfig = 'ZIMonSensors-protocols-wrong.cfg'
17
15
sensorsCount = 0
18
16
17
+
19
18
@with_setup (my_setup )
20
19
def test_case01 ():
21
20
with assert_helper .assertRaises (OSError ):
22
- sensorsList = readSensorsConfig (logger )
21
+ readSensorsConfig (logger )
22
+
23
23
24
24
@with_setup (my_setup )
25
25
def test_case02 ():
26
26
zimonFile = os .path .join (path , "tests" , "test_data" , mainSensorsConfig )
27
27
sensorsList = readSensorsConfig (logger , zimonFile )
28
- assert isinstance (sensorsList , list )
28
+ assert isinstance (sensorsList , list )
29
29
assert len (sensorsList ) > 0
30
30
31
+
31
32
@with_setup (my_setup )
32
33
def test_case03 ():
33
34
zimonFile = os .path .join (path , "tests" , "test_data" , wrongSensorsConfig )
34
35
sensorsList = readSensorsConfig (logger , zimonFile )
35
- assert isinstance (sensorsList , list )
36
+ assert isinstance (sensorsList , list )
36
37
assert len (sensorsList ) > 0
37
38
39
+
38
40
@with_setup (my_setup )
39
41
def test_case04 ():
40
42
zimonFile = os .path .join (path , "tests" , "test_data" , mainSensorsConfig )
41
43
sensorsList = readSensorsConfig (logger , zimonFile )
42
44
sensorsCount = len (sensorsList )
45
+ assert sensorsCount == 32
43
46
44
47
zimonFile = os .path .join (path , "tests" , "test_data" )
45
- print (zimonFile )
46
48
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