@staticmethod
PYL-R0201165 for exp, act in zip(expected, actual):
166 self.assertEqual(exp, act)
167
168 def test_wrong_dest(self):169 # Some cases of invalid input, e.g. invalid/missing port.
170 dests = [
171 "1.2.3.4", # No port
17 def getHandle(self):
18 return s
19
20 def setTcpKeepAlive(self, value): 21 s.setsockopt(socket.SOL_TCP, socket.SO_KEEPALIVE, value)
22
23 enableTcpKeepAlive(_Transport(), True, None)
14 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
15
16 class _Transport():
17 def getHandle(self): 18 return s
19
20 def setTcpKeepAlive(self, value):
121 port = self.instance_ports[(server, instance)]
122 yield (server, port, instance)
123
124 def getKey(self, metric):125 return metric
126
127
13
14
15class TestMetricReceiversHandler(TestCase):
16 def test_build(self): 17 expected_plugins = sorted(['line', 'udp', 'pickle', 'protobuf'])
18
19 # amqp not supported with py3
The method doesn't use its bound instance. Decorate this method with @staticmethod
decorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods here.