Exemplo n.º 1
0
 def override(self, service_patcher, config_patcher):
     config_patcher(1, 'ws.call_timeout')
     service_patcher('test', self)
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 4
0
 def override(self, service_patcher, config_patcher):
     config_patcher(1, 'ws.call_timeout')
     service_patcher('test', self)
Exemplo n.º 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
Exemplo n.º 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