Ejemplo n.º 1
0
    def test_get_raises(self, exc_info):

        result = WaitResult()
        result.send(1, exc_info)
        with pytest.raises(self.CustomError):
            result.get()
Ejemplo n.º 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
Ejemplo n.º 3
0
 def test_get_result_multiple_times(self):
     result = WaitResult()
     result.send(1, None)
     assert result.get() == 1
     assert result.get() == 1
Ejemplo n.º 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
Ejemplo n.º 5
0
    def test_get_raises(self, exc_info):

        result = WaitResult()
        result.send(1, exc_info)
        with pytest.raises(self.CustomError):
            result.get()
Ejemplo n.º 6
0
 def test_get_result_multiple_times(self):
     result = WaitResult()
     result.send(1, None)
     assert result.get() == 1
     assert result.get() == 1
Ejemplo n.º 7
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
Ejemplo n.º 8
0
 def test_has_result(self):
     result = WaitResult()
     assert result.has_result is False
     result.send("ok", None)
     assert result.has_result is True