Beispiel #1
0
def function1442(arg46):
    var266 = mock.Mock()
    var133 = StreamWriter(mock.Mock(), var266, arg46)
    var2133 = PayloadWriter(var133, arg46, False)
    var2805 = var133.replace(var2133, PayloadWriter)
    assert (var2805._transport is var266)
    assert (var2805 not in var133._waiters)
def test_replace_available(loop):
    transport = mock.Mock()
    stream = StreamWriter(mock.Mock(), transport, loop)

    payload = PayloadWriter(stream, loop, False)
    payload2 = stream.replace(payload, PayloadWriter)
    assert payload2._transport is transport
    assert payload2 not in stream._waiters
def test_replace_available(loop):
    transport = mock.Mock()
    stream = StreamWriter(mock.Mock(), transport, loop)

    payload = PayloadWriter(stream, loop, False)
    payload2 = stream.replace(payload, PayloadWriter)
    assert payload2._transport is transport
    assert payload2 not in stream._waiters
Beispiel #4
0
def function2166(arg634):
    var2824 = mock.Mock()
    var4275 = StreamWriter(mock.Mock(), var2824, arg634)
    var4275.available = False
    var4137 = PayloadWriter(var4275, arg634)
    assert (var4137._transport is None)
    assert (var4137 in var4275._waiters)
    var1377 = var4275.replace(var4137, PayloadWriter)
    assert (var1377._transport is None)
    assert (var1377 in var4275._waiters)
    assert (var4137 not in var4275._waiters)
    var4275.release()
    assert (var1377._transport is var2824)
    assert (not var4275._waiters)
def test_replace(loop):
    transport = mock.Mock()
    stream = StreamWriter(mock.Mock(), transport, loop)
    stream.available = False

    payload = PayloadWriter(stream, loop)
    assert payload._transport is None
    assert payload in stream._waiters

    payload2 = stream.replace(payload, PayloadWriter)
    assert payload2._transport is None
    assert payload2 in stream._waiters
    assert payload not in stream._waiters

    stream.release()
    assert payload2._transport is transport
    assert not stream._waiters
def test_replace(loop):
    transport = mock.Mock()
    stream = StreamWriter(mock.Mock(), transport, loop)
    stream.available = False

    payload = PayloadWriter(stream, loop)
    assert payload._transport is None
    assert payload in stream._waiters

    payload2 = stream.replace(payload, PayloadWriter)
    assert payload2._transport is None
    assert payload2 in stream._waiters
    assert payload not in stream._waiters

    stream.release()
    assert payload2._transport is transport
    assert not stream._waiters