def test_parse_http_basic_auth(): assert proxyauth.parse_http_basic_auth(proxyauth.mkauth( "test", "test")) == ("basic", "test", "test") assert not proxyauth.parse_http_basic_auth("") assert not proxyauth.parse_http_basic_auth("foo bar") v = "basic " + binascii.b2a_base64(b"foo").decode("ascii") assert not proxyauth.parse_http_basic_auth(v)
def test_parse_http_basic_auth(): assert proxyauth.parse_http_basic_auth( proxyauth.mkauth("test", "test") ) == ("basic", "test", "test") assert not proxyauth.parse_http_basic_auth("") assert not proxyauth.parse_http_basic_auth("foo bar") v = "basic " + binascii.b2a_base64(b"foo").decode("ascii") assert not proxyauth.parse_http_basic_auth(v)
def test_parse_http_basic_auth(): assert proxyauth.parse_http_basic_auth(proxyauth.mkauth( "test", "test")) == ("basic", "test", "test") with pytest.raises(ValueError): proxyauth.parse_http_basic_auth("") with pytest.raises(ValueError): proxyauth.parse_http_basic_auth("foo bar") with pytest.raises(ValueError): proxyauth.parse_http_basic_auth("basic abc") with pytest.raises(ValueError): v = "basic " + binascii.b2a_base64(b"foo").decode("ascii") proxyauth.parse_http_basic_auth(v)
def test_parse_http_basic_auth(): assert proxyauth.parse_http_basic_auth( proxyauth.mkauth("test", "test") ) == ("basic", "test", "test") with pytest.raises(ValueError): proxyauth.parse_http_basic_auth("") with pytest.raises(ValueError): proxyauth.parse_http_basic_auth("foo bar") with pytest.raises(ValueError): proxyauth.parse_http_basic_auth("basic abc") with pytest.raises(ValueError): v = "basic " + binascii.b2a_base64(b"foo").decode("ascii") proxyauth.parse_http_basic_auth(v)
def test_parse_http_basic_auth(self): input = proxyauth.mkauth("test", "test") assert proxyauth.parse_http_basic_auth(input) == ("basic", "test", "test")
def test_parse_http_basic_auth_error(self, input): with pytest.raises(ValueError): proxyauth.parse_http_basic_auth(input)
def test_parse_http_basic_auth(self): input = proxyauth.mkauth("test", "test") assert proxyauth.parse_http_basic_auth(input) == ("basic", "test", "test")
def test_parse_http_basic_auth_error(self, input): with pytest.raises(ValueError): proxyauth.parse_http_basic_auth(input)