Exemplo n.º 1
0
class FeedTest(DjangoTestCase):
    base_url = "http://127.0.0.1:%s/%s"
    fixtures = ["base.json"]

    def setUp(self):
        # Disable logging to the console
        logging.disable(logging.CRITICAL + 1)

        self.cond = threading.Condition()
        self.server = FeedParserTestServer(self.cond)
        self.cond.acquire()
        self.server.start()

        # Wait until the server is ready
        while not self.server.ready:
            # Collect left over servers so they release their
            # sockets
            import gc
            gc.collect()
            self.cond.wait()

        self.cond.release()

    def get_url(self, path):
        return self.base_url % (PORT, path)

    def tearDown(self):
        self.server = None
        stop_server(PORT)
Exemplo n.º 2
0
class FeedTest(DjangoTestCase):
    base_url = "http://127.0.0.1:%s/%s"
    fixtures = ["base.json"]

    def setUp(self):
        # Disable logging to the console
        logging.disable(logging.CRITICAL+1)

        self.cond = threading.Condition()
        self.server = FeedParserTestServer(self.cond) 
        self.cond.acquire()
        self.server.start()

        # Wait until the server is ready
        while not self.server.ready:
            # Collect left over servers so they release their
            # sockets
            import gc
            gc.collect()
            self.cond.wait()

        self.cond.release()

    def get_url(self, path):
        return self.base_url % (PORT, path)

    def tearDown(self):
        self.server = None
        stop_server(PORT)
Exemplo n.º 3
0
    def setUp(self):
        # Disable logging to the console
        logging.disable(logging.CRITICAL + 1)

        self.cond = threading.Condition()
        self.server = FeedParserTestServer(self.cond)
        self.cond.acquire()
        self.server.start()

        # Wait until the server is ready
        while not self.server.ready:
            # Collect left over servers so they release their
            # sockets
            import gc
            gc.collect()
            self.cond.wait()

        self.cond.release()
Exemplo n.º 4
0
    def setUp(self):
        # Disable logging to the console
        logging.disable(logging.CRITICAL+1)

        self.cond = threading.Condition()
        self.server = FeedParserTestServer(self.cond) 
        self.cond.acquire()
        self.server.start()

        # Wait until the server is ready
        while not self.server.ready:
            # Collect left over servers so they release their
            # sockets
            import gc
            gc.collect()
            self.cond.wait()

        self.cond.release()