Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_available_connections_too_much_acquires():
ac = aioftp.AvailableConnections(3)
ac.acquire()
ac.acquire()
ac.acquire()
with pytest.raises(ValueError):
ac.acquire()
def test_available_connections_too_much_releases():
ac = aioftp.AvailableConnections(3)
ac.acquire()
ac.release()
ac.release()
def test_available_connections_too_much_acquires():
ac = aioftp.AvailableConnections(3)
ac.acquire()
ac.acquire()
ac.acquire()
ac.acquire()
def test_available_connections_too_much_releases():
ac = aioftp.AvailableConnections(3)
ac.acquire()
ac.release()
with pytest.raises(ValueError):
ac.release()