def setUp(self):
        self.settings = Settings.load_config('../conf.json')

        # Centrifuge uses it's own internal process.
        # During running the tests this process prevents correct server shutdown and socket does not returns port.
        # To prevent it - centrifuge should be simply disabled.
        # (it is not used in this tests)
        self.settings.use_centrifuge = False

        self.core = Core(self.settings)

        def run():
            # It is necessary to seed random in forked process,
            # otherwise - Crypto would throw an error.
            Random.atfork()

            self.core.run()

        self.process = Process(target=run)
        self.process.start()

        # Wait until server would be stopped.
        sleep(0.5)
Esempio n. 2
0
from core.core import Core
from core.settings import Settings

if __name__ == '__main__':
    settings = Settings.load_config()
    core = Core(settings).run()
Esempio n. 3
0
 def setUp(self):
     self.settings = Settings.load_config('../../../conf.json')
     self.handler = ClientsHandler(self.settings)
     self.handler._redis().flushdb()