Skip to content

Commit 63e0030

Browse files
committed
fix flake8 code review findings
Signed-off-by: hwassman <[email protected]>
1 parent 7be2bc6 commit 63e0030

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

source/queryHandler/SensorConfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def readSensorsConfig(logger=None, customFile=None):
7878
for file in files:
7979
if file.endswith(".cfg"):
8080
sensorConfigFiles.append(os.path.join(root, file))
81-
else :
81+
else:
8282
logger.details("ZiMon sensor configuration file not found (%s) ", zimonFile)
8383
print("ZiMon sensor configuration file not found")
8484
raise OSError(2, 'No such file or directory', zimonFile)

tests/test_zimon_config_parser.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from source.bridgeLogger import configureLogging
55
from nose2.tools.such import helper as assert_helper
66
from nose2.tools.decorators import with_setup
7-
from argparse import Namespace
8-
97

108

119
def 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)
2019
def test_case01():
2120
with assert_helper.assertRaises(OSError):
22-
sensorsList = readSensorsConfig(logger)
21+
readSensorsConfig(logger)
22+
2323

2424
@with_setup(my_setup)
2525
def 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)
3233
def 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)
3941
def 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

Comments
 (0)