Ejemplo n.º 1
0
    def test_presence(self):
        '''
        Test for presence retrieving.
        '''
        presence = Presence([('127.0.0.1', True)])
        server = start_test_server()
        try:

            self.assertTrue(
                presence.is_absent('mcihar', datetime.date(2013, 7, 15)) is
                None)
            self.assertFalse(
                presence.is_absent('mcihar', datetime.date(2013, 10, 28)) is
                None)
        finally:
            stop_test_server(*server)
Ejemplo n.º 2
0
    def test_presence(self):
        '''
        Test for presence retrieving.
        '''
        presence = Presence([('127.0.0.1', True)])
        server = start_test_server()
        try:

            self.assertTrue(
                presence.is_absent('mcihar', datetime.date(2013, 7, 15))
                is None
            )
            self.assertFalse(
                presence.is_absent('mcihar', datetime.date(2013, 10, 28))
                is None
            )
        finally:
            stop_test_server(*server)
Ejemplo n.º 3
0
    def test_presence(self):
        presence = Presence([('127.0.0.1', True)])
        SocketServer.TCPServer.allow_reuse_address = True
        server = SocketServer.TCPServer(('127.0.0.1', 9874), MyTCPHandler)
        server_thread = threading.Thread(target=server.serve_forever)
        server_thread.daemon = False
        server_thread.start()
        try:

            self.assertTrue(
                presence.is_absent('mcihar', datetime.date(2013, 7, 15))
                is None
            )
            self.assertFalse(
                presence.is_absent('mcihar', datetime.date(2013, 10, 28))
                is None
            )
        finally:
            server.shutdown()
            server_thread.join()
Ejemplo n.º 4
0
    def test_presence(self):
        '''
        Test for presence retrieving.
        '''
        presence = Presence([('127.0.0.1', True)])
        SocketServer.TCPServer.allow_reuse_address = True
        server = SocketServer.TCPServer(('127.0.0.1', 9874), MyTCPHandler)
        server_thread = threading.Thread(target=server.serve_forever)
        server_thread.daemon = False
        server_thread.start()
        try:

            self.assertTrue(
                presence.is_absent('mcihar', datetime.date(2013, 7, 15))
                is None
            )
            self.assertFalse(
                presence.is_absent('mcihar', datetime.date(2013, 10, 28))
                is None
            )
        finally:
            server.shutdown()
            server_thread.join()