コード例 #1
0
ファイル: test_pool.py プロジェクト: marik332000/tinys3
    def test_response_timeout(self):
        """
        Test response with a timeout
        """
        # New result
        r = AsyncResponse()

        # Get the value, with 1 second timeout. this should always fail
        r.response(1)
コード例 #2
0
    def test_response_timeout(self):
        """
        Test response with a timeout
        """
        # New result
        r = AsyncResponse()

        # Get the value, with 1 second timeout. this should always fail
        r.response(1)
コード例 #3
0
ファイル: test_pool.py プロジェクト: marik332000/tinys3
    def test_create_and_resolve(self):
        """
        The most basic test for getting and setting results
        """
        # Create a new result
        r = AsyncResponse()

        # Should not be ready
        self.assertFalse(r.completed)

        # set the result
        r.resolve(TEST_RESPONSE)

        # Is the result ready
        self.assertTrue(r.completed)

        # test getting the result
        self.assertEqual(r.response(), TEST_RESPONSE)
コード例 #4
0
    def test_create_and_resolve(self):
        """
        The most basic test for getting and setting results
        """
        # Create a new result
        r = AsyncResponse()

        # Should not be ready
        self.assertFalse(r.completed)

        # set the result
        r.resolve(TEST_RESPONSE)

        # Is the result ready
        self.assertTrue(r.completed)

        # test getting the result
        self.assertEqual(r.response(), TEST_RESPONSE)