예제 #1
0
    def test_get_raises(self, exc_info):

        result = WaitResult()
        result.send(1, exc_info)
        with pytest.raises(self.CustomError):
            result.get()
예제 #2
0
 def test_has_exception(self, exc_info):
     result = WaitResult()
     assert result.has_result is False
     result.send(None, exc_info)
     assert result.has_result is True
예제 #3
0
 def test_get_result_multiple_times(self):
     result = WaitResult()
     result.send(1, None)
     assert result.get() == 1
     assert result.get() == 1
예제 #4
0
 def test_has_result(self):
     result = WaitResult()
     assert result.has_result is False
     result.send("ok", None)
     assert result.has_result is True