Beispiel #1
0
 def test_missing_publickey(self):
     ss = sender.ServerSender(manager=None,
                              config=auxiliaries.Config(test_config_path),
                              publickey=None,
                              verbosity=4)
     with self.assertRaises(sender.MissingFile):
         ss.send_cpm(0, 0)
Beispiel #2
0
def main():
    config = aux.Config(DEFAULT_CONFIG)
    publickey = aux.PublicKey(DEFAULT_PUBLICKEY)

    sender = ServerSender(port=TESTING_TCP_PORT,
                          config=config,
                          publickey=publickey,
                          mode='tcp')

    # test basic new data protocol (1 TCP request)
    test_new_data(sender)

    # test basic old data protocol (1)
    test_old_data(sender)

    # test basic log (1)
    test_log(sender)

    # test UnencryptedPacket (1)
    test_unencrypted(sender)

    # test BadPacket (1)
    test_bad_packet(sender)

    # test PacketLengthError (2)
    test_packet_length(sender)

    # test HashLengthError (3)
    test_hash_length(sender)

    # test ExcessiveCountrate (2)
    test_countrate(sender)
Beispiel #3
0
 def test(self):
     config = auxiliaries.Config(test_config_path, verbosity=2)
     self.assertIsNotNone(config.ID)
     self.assertIsNotNone(config.hash)
     self.assertIsNotNone(config.lat)
     self.assertIsNotNone(config.long)