[Git][NTPsec/ntpsec][master] PEP8: E231 missing whitespace after ':'

Matt Selsky gitlab at mg.gitlab.com
Mon Aug 6 23:51:35 UTC 2018


Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
15a040cc by Matt Selsky at 2018-08-06T23:47:39Z
PEP8: E231 missing whitespace after ':'

- - - - -


3 changed files:

- pylib/agentx.py
- tests/pylib/test_agentx.py
- tests/pylib/test_packet.py


Changes:

=====================================
pylib/agentx.py
=====================================
@@ -67,8 +67,8 @@ class MIBControl:
             node, remainingOID = ntp.util.slicedata(remainingOID, 1)
             node = node[0]
             if node not in currentLevel.keys():
-                currentLevel[node] = {"reader":None, "writer":None,
-                                      "subids":None}
+                currentLevel[node] = {"reader": None, "writer": None,
+                                      "subids": None}
             if len(remainingOID) == 0:  # We have reached the target node
                 currentLevel[node]["reader"] = reader
                 currentLevel[node]["writer"] = writer


=====================================
tests/pylib/test_agentx.py
=====================================
@@ -44,26 +44,26 @@ class TestMIBControl(unittest.TestCase):
         # Top level, non-dynamic
         c.addNode((0,), 1, 2)
         self.assertEqual(c.oidTree,
-                         {0:{"reader":1, "writer":2, "subids":None}})
+                         {0: {"reader": 1, "writer": 2, "subids": None}})
         # Top level, non-dynamic, class OID
         c.addNode(AP.OID((1,)), 1, 2)
         self.assertEqual(c.oidTree,
-                         {0:{"reader":1, "writer":2, "subids":None},
-                          1:{"reader":1, "writer":2, "subids":None}})
+                         {0: {"reader": 1, "writer": 2, "subids": None},
+                          1: {"reader": 1, "writer": 2, "subids": None}})
         # Top level, dynamic
         c.addNode((2,), dynamic=3)
         self.assertEqual(c.oidTree,
-                         {0:{"reader":1, "writer":2, "subids":None},
-                          1:{"reader":1, "writer":2, "subids":None},
-                          2:{"reader":None, "writer":None, "subids":3}})
+                         {0: {"reader": 1, "writer": 2, "subids": None},
+                          1: {"reader": 1, "writer": 2, "subids": None},
+                          2: {"reader": None, "writer": None, "subids": 3}})
         # Sub level
         c.addNode((1, 2, 3), 1, 2)
         self.assertEqual(c.oidTree,
-                         {0:{"reader":1, "writer":2, "subids":None},
-                          1:{"reader":1, "writer":2, "subids":
-                             {2:{"reader":None, "writer":None, "subids":{
-                                 3:{"reader":1, "writer":2, "subids":None}}}}},
-                          2:{"reader":None, "writer":None, "subids":3}})
+                         {0: {"reader": 1, "writer": 2, "subids": None},
+                          1: {"reader": 1, "writer": 2, "subids":
+                             {2: {"reader": None, "writer": None, "subids": {
+                                 3: {"reader": 1, "writer": 2, "subids": None}}}}},
+                          2: {"reader": None, "writer": None, "subids": 3}})
 
     def test_getOID_andNext(self):
         c = AX.MIBControl()
@@ -336,8 +336,8 @@ class TestPacketControl(unittest.TestCase):
         callback = (lambda resp, pkt: returns.append((resp, pkt)))
         faketimemod = jigs.TimeModuleJig()
         p = AX.PacketControl(None, None)
-        p.packetLog = {(42, 23, 100):(25, "foo", callback),
-                       (42, 24, 200):(50, "bar", callback)}
+        p.packetLog = {(42, 23, 100): (25, "foo", callback),
+                       (42, 24, 200): (50, "bar", callback)}
         faketimemod.time_returns = [40]
         try:
             timetemp = AX.time
@@ -345,7 +345,7 @@ class TestPacketControl(unittest.TestCase):
             p.checkResponses()
             self.assertEqual(returns, [(None, "foo")])
             self.assertEqual(p.packetLog,
-                             {(42, 24, 200):(50, "bar", callback)})
+                             {(42, 24, 200): (50, "bar", callback)})
         finally:
             AX.time = timetemp
 
@@ -392,7 +392,7 @@ class TestPacketControl(unittest.TestCase):
                                      b"\x00\x00\x00\x00\x00\x00\x00\x01"
                                      b"\x00\x00\x00\x02\x00\x00\x00\x08"
                                      b"\x00\x00\x00\x04fake"])
-        self.assertEqual(p.packetLog, {(0, 1, 2):(30.0, testpkt, "foo")})
+        self.assertEqual(p.packetLog, {(0, 1, 2): (30.0, testpkt, "foo")})
 
     def test_sendPing(self):
         sock = jigs.SocketJig()
@@ -424,8 +424,8 @@ class TestPacketControl(unittest.TestCase):
         sock = jigs.SocketJig()
         p = AX.PacketControl(sock, None)
         p.sessionID = 42
-        header = {"flags":{"bigEndian":True}, "session_id":42,
-                  "transaction_id":32, "packet_id":100}
+        header = {"flags": {"bigEndian": True}, "session_id": 42,
+                  "transaction_id": 32, "packet_id": 100}
         p.sendErrorResponse(header, AP.ERR_GENERR, 12)
         self.assertEqual(sock.data,
                          [b"\x01\x12\x10\x00"
@@ -717,10 +717,10 @@ class TestPacketControl(unittest.TestCase):
         sock = jigs.SocketJig()
         p = AX.PacketControl(sock, None)
         p.sessionID = 42
-        p.packetLog = {(42, 4, 50):(30.0, opkt, callback)}
+        p.packetLog = {(42, 4, 50): (30.0, opkt, callback)}
         # Test non-expected response (likely to happen in a timeout)
         p.handle_ResponsePDU(incorrect_rpkt)
-        self.assertEqual(p.packetLog, {(42, 4, 50):(30.0, opkt, callback)})
+        self.assertEqual(p.packetLog, {(42, 4, 50): (30.0, opkt, callback)})
         # Test expected response
         p.handle_ResponsePDU(correct_rpkt)
         self.assertEqual(p.packetLog, {})


=====================================
tests/pylib/test_packet.py
=====================================
@@ -1663,7 +1663,7 @@ class TestControlSession(unittest.TestCase):
             queries = []
             result = cls.mrulist(variables={"sort": "addr",
                                             "frags": 24,
-                                            "resall":5})
+                                            "resall": 5})
             self.assertEqual(nonce_fetch_count, [4])
             self.assertEqual(queries,
                              [(10, 0, "nonce=foo, frags=24, resall=0x5", False),



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/15a040ccec8d59c6fe788b76efc0494357e2a0a9

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/15a040ccec8d59c6fe788b76efc0494357e2a0a9
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20180806/8feb5975/attachment-0001.html>


More information about the vc mailing list