Beispiel #1
0
 def override(self, service_patcher, config_patcher):
     config_patcher(1, 'ws.call_timeout')
     service_patcher('test', self)
Beispiel #2
0
def test_call_timeout(ws, config_patcher, monkeypatch):
    monkeypatch.setattr(stopped, 'is_set', Mock(return_value=False))
    config_patcher(1, 'ws.call_timeout')
    pytest.raises(Exception, ws.call, 'foo.bar')
    assert 'xxx' not in ws._callbacks
    assert 9 <= stopped.is_set.call_count <= 11
Beispiel #3
0
def test_call_timeout(ws, config_patcher, monkeypatch):
    monkeypatch.setattr(stopped, 'is_set', Mock(return_value=False))
    config_patcher(1, 'ws.call_timeout')
    pytest.raises(Exception, ws.call, 'foo.bar')
    assert 'xxx' not in ws._callbacks
    assert 9 <= stopped.is_set.call_count <= 11
Beispiel #4
0
 def override(self, service_patcher, config_patcher):
     config_patcher(1, 'ws.call_timeout')
     service_patcher('test', self)
Beispiel #5
0
def test_call_timeout(ws, config_patcher, monkeypatch):
    monkeypatch.setattr(stopped, 'wait', Mock())
    config_patcher(1, 'ws.call_timeout')
    pytest.raises(Exception, ws.call, 'foo.bar')
    assert 'xxx' not in ws._callbacks
    assert stopped.wait.call_count == 10
Beispiel #6
0
def test_call_timeout(ws, config_patcher, monkeypatch):
    monkeypatch.setattr(stopped, 'wait', Mock())
    config_patcher(1, 'ws.call_timeout')
    pytest.raises(Exception, ws.call, 'foo.bar')
    assert 'xxx' not in ws._callbacks
    assert stopped.wait.call_count == 10