summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2017-07-31 20:12:35 -0700
committerGary E. Miller <gem@rellim.com>2017-07-31 20:12:35 -0700
commit694efb7da8fe7564b3dae435fe17c908a949b991 (patch)
treed7b830ea9e7b5985031051ce39c26a2ad67f7d3c
parenteda00425a6a542a1596f09868853b38b327daf3c (diff)
downloadgpsd-694efb7da8fe7564b3dae435fe17c908a949b991.tar.gz
gps/fake.py: code rearrangement to handle pylint complexity warning
-rw-r--r--gps/fake.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/gps/fake.py b/gps/fake.py
index 8fa5111c..b743db22 100644
--- a/gps/fake.py
+++ b/gps/fake.py
@@ -590,6 +590,7 @@ class DaemonInstance(SubprogramInstance):
class TestSessionError(TestError):
+ # why does testSessionError() return pass? "
pass
@@ -747,16 +748,17 @@ class TestSession(object):
chosen.enqueued = ""
while chosen.waiting():
chosen.read()
- if chosen.valid & gps.PACKET_SET:
- self.reporter(chosen.bresponse)
- if ((chosen.data["class"] == "DEVICE"
- and chosen.data["activated"] == 0
- and chosen.data["path"] in self.fakegpslist)):
- self.gps_remove(chosen.data["path"])
- self.progress(
- "gpsfake: GPS %s removed (notification)\n"
- % chosen.data["path"])
had_output = True
+ if not chosen.valid & gps.PACKET_SET:
+ continue
+ self.reporter(chosen.bresponse)
+ if ((chosen.data["class"] == "DEVICE"
+ and chosen.data["activated"] == 0
+ and chosen.data["path"] in self.fakegpslist)):
+ self.gps_remove(chosen.data["path"])
+ self.progress(
+ "gpsfake: GPS %s removed (notification)\n"
+ % chosen.data["path"])
else:
raise TestSessionError("test object of unknown type")
if not self.writers and not had_output: