Exemplo n.º 1
0
    def setUp(self):
        common.reset_config()
        config.Config()


        self.test_host = {"host": "127.0.0.1", 
                          "port": 9999,
                          "addresses": ["123.45.67.8"]}

        r = redis.Redis()
        r.setex('host_123.45.67.8', JSONEncoder().encode(self.test_host), 10)


        self.announcement = protocol.Packet('hi!', {'host': '123.45.67.89'})
        self.export = protocol.Packet('i have', {'host': '123.45.67.89', 
                                                 "type": 'addresses',
                                                 'export':["123.45.67.89"]})
        self.query = protocol.Packet("heard of?", {"type": 'addresses',
                                                   "value": '123.45.67.8'})
Exemplo n.º 2
0
 def setUp(self):
     common.reset_config()
Exemplo n.º 3
0
 def teardown(self):
     common.reset_config()
Exemplo n.º 4
0
    def setUp(self):
        common.reset_config()

        self.config = Config(config_files=["tests/data/redis.cfg"])
        self.redis = redis.Redis(config=self.config)