def test_many_messages(self):
     avail = collectd.MAX_PACKET_SIZE - len(collectd.message_start())
     val_size = len(collectd.pack("xxxx", 0))
     too_many = avail // val_size + 1
     stats = dict(("{0:04}".format(i), i) for i in range(too_many))
     self.assertValidMessages(2, stats)
Ejemplo n.º 2
0
 def test_many_messages(self):
     avail = collectd.MAX_PACKET_SIZE - len(collectd.message_start())
     val_size = len(collectd.pack("xxxx", 0))
     too_many = avail // val_size + 1
     stats = dict(("{0:04}".format(i), i) for i in range(too_many))
     self.assertValidMessages(2, stats)
 def test_start_valid(self):
     for params in [{}, {"host":""}, {"when":time.time()}]:
         self.assertValidPacket(5, collectd.message_start(**params))
Ejemplo n.º 4
0
 def test_start_valid(self):
     for params in [{}, {"host": ""}, {"when": time.time()}]:
         self.assertValidPacket(6, collectd.message_start(**params))