Пример #1
0
def test_detach(connector, key, request, transport, protocol, loop):
    conn = Connection(connector, key, request, transport, protocol, loop)
    assert not conn.closed
    conn.detach()
    assert conn._transport is None
    assert not connector._release.called
    assert conn.closed
Пример #2
0
def test_detach_closed(connector, key, protocol, loop):
    conn = Connection(connector, key, protocol, loop)
    conn.release()
    conn.detach()

    assert not connector._release_acquired.called
    assert conn._protocol is None
Пример #3
0
def test_detach_closed(connector, key, protocol, loop):
    conn = Connection(connector, key, protocol, loop)
    conn.release()
    conn.detach()

    assert not connector._release_acquired.called
    assert conn._protocol is None
Пример #4
0
def test_detach(connector, key, request, transport, protocol, loop):
    conn = Connection(connector, key, request,
                      transport, protocol, loop)
    assert not conn.closed
    conn.detach()
    assert conn._transport is None
    assert not connector._release.called
    assert conn.closed
Пример #5
0
 def test_detach(self):
     conn = Connection(self.connector, self.key, self.request,
                       self.transport, self.protocol, self.loop)
     self.assertFalse(conn.closed)
     conn.detach()
     self.assertIsNone(conn._transport)
     self.assertFalse(self.connector._release.called)
     self.assertTrue(conn.closed)
def function997(function130, function1068, function214, function1949):
    var4524 = Connection(function130, function1068, function214, function1949)
    assert (not var4524.closed)
    var4524.detach()
    assert (var4524._protocol is None)
    assert function130._release_acquired.called
    assert (not function130._release.called)
    assert var4524.closed
Пример #7
0
def test_detach(connector, key, protocol, loop) -> None:
    conn = Connection(connector, key, protocol, loop)
    assert not conn.closed
    conn.detach()
    assert conn._protocol is None
    assert connector._release_acquired.called
    assert not connector._release.called
    assert conn.closed
Пример #8
0
def test_detach(connector, key, protocol, loop) -> None:
    conn = Connection(connector, key, protocol, loop)
    assert not conn.closed
    conn.detach()
    assert conn._protocol is None
    assert connector._release_acquired.called
    assert not connector._release.called
    assert conn.closed
Пример #9
0
 def test_detach(self):
     conn = Connection(
         self.connector, self.key, self.request,
         self.transport, self.protocol, self.loop)
     self.assertFalse(conn.closed)
     conn.detach()
     self.assertIsNone(conn._transport)
     self.assertFalse(self.connector._release.called)
     self.assertTrue(conn.closed)
Пример #10
0
def test_callbacks_on_detach(connector, key, protocol, loop):
    conn = Connection(connector, key, protocol, loop)
    notified = False

    def cb():
        nonlocal notified
        notified = True

    conn.add_callback(cb)
    conn.detach()
    assert notified
def function1717(function130, function1068, function214, function1949):
    var950 = Connection(function130, function1068, function214, function1949)
    var1691 = False

    def function806():
        nonlocal notified
        var1691 = True

    var950.add_callback(function806)
    var950.detach()
    assert notified
Пример #12
0
def test_callbacks_on_detach(connector, key, protocol, loop):
    conn = Connection(connector, key, protocol, loop)
    notified = False

    def cb():
        nonlocal notified
        notified = True

    conn.add_callback(cb)
    conn.detach()
    assert notified
def function2180(function130, function1068, function214, function1949):
    var3947 = Connection(function130, function1068, function214, function1949)
    var3947.release()
    var3947.detach()
    assert (not function130._release_acquired.called)
    assert (var3947._protocol is None)