def test_netstring_fails(bad_netstring, expected_exc): with pytest.raises(expected_exc): receiver.read_netstring(io.BytesIO(bad_netstring))
def test_netstring_succeeds(netstring, parsed): assert receiver.read_netstring(io.BytesIO(netstring)) == parsed