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_auth_string():
assert auth_or_string("hello:world") == BasicAuth("hello", "world")
assert auth_or_string(None) == None
assert auth_or_string(BasicAuth("foo", "bar")) == BasicAuth("foo", "bar")
with pytest.raises(TypeError):
auth_or_string(1)
def test_auth_string():
assert auth_or_string("hello:world") == BasicAuth("hello", "world")
assert auth_or_string(None) == None
assert auth_or_string(BasicAuth("foo", "bar")) == BasicAuth("foo", "bar")
with pytest.raises(TypeError):
auth_or_string(1)
def test_auth_string():
assert auth_or_string("hello:world") == BasicAuth("hello", "world")
assert auth_or_string(None) == None
assert auth_or_string(BasicAuth("foo", "bar")) == BasicAuth("foo", "bar")
with pytest.raises(TypeError):
auth_or_string(1)
def test_auth_string():
assert auth_or_string("hello:world") == BasicAuth("hello", "world")
assert auth_or_string(None) == None
assert auth_or_string(BasicAuth("foo", "bar")) == BasicAuth("foo", "bar")
with pytest.raises(TypeError):
auth_or_string(1)