def test_unix_cleanup(self):
     sockets = CircusSockets()
     sockfile = self._get_tmp_filename()
     try:
         sockets.add('unix', path=sockfile)
         sockets.bind_and_listen_all()
         self.assertTrue(os.path.exists(sockfile))
     finally:
         sockets.close_all()
         self.assertTrue(not os.path.exists(sockfile))
예제 #2
0
 def test_unix_cleanup(self):
     sockets = CircusSockets()
     sockfile = self._get_tmp_filename()
     try:
         sockets.add('unix', path=sockfile)
         sockets.bind_and_listen_all()
         self.assertTrue(os.path.exists(sockfile))
     finally:
         sockets.close_all()
         self.assertTrue(not os.path.exists(sockfile))
예제 #3
0
    def test_manager(self):
        mgr = CircusSockets()

        for i in range(5):
            mgr.add(str(i), 'localhost', 0)

        port = mgr['1'].port
        try:
            mgr.bind_and_listen_all()
            # we should have a port now
            self.assertNotEqual(port, mgr['1'].port)
        finally:
            mgr.close_all()
예제 #4
0
    def test_unix_cleanup(self):
        sockets = CircusSockets()
        fd, sockfile = tempfile.mkstemp()
        os.close(fd)
        os.remove(sockfile)

        try:
            sockets.add('unix', path=sockfile)
            sockets.bind_and_listen_all()
            self.assertTrue(os.path.exists(sockfile))
        finally:
            sockets.close_all()
            self.assertTrue(not os.path.exists(sockfile))
예제 #5
0
    def test_unix_cleanup(self):
        sockets = CircusSockets()
        fd, sockfile = tempfile.mkstemp()
        os.close(fd)
        os.remove(sockfile)

        try:
            sockets.add('unix', path=sockfile)
            sockets.bind_and_listen_all()
            self.assertTrue(os.path.exists(sockfile))
        finally:
            sockets.close_all()
            self.assertTrue(not os.path.exists(sockfile))
예제 #6
0
    def test_manager(self):
        mgr = CircusSockets()

        for i in range(5):
            mgr.add(str(i), 'localhost', 0)

        port = mgr['1'].port
        try:
            mgr.bind_and_listen_all()
            # we should have a port now
            self.assertNotEqual(port, mgr['1'].port)
        finally:
            mgr.close_all()