Skip to content

Commit

Permalink
change port in test
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Dec 30, 2020
1 parent 6daeefc commit 2dbbe5b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/test_networks.py
Expand Up @@ -328,24 +328,24 @@ def test_redis_dsns():
class Model(BaseModel):
a: RedisDsn

m = Model(a='redis://user:pass@localhost:6379/app')
assert m.a == 'redis://user:pass@localhost:6379/app'
m = Model(a='redis://user:pass@localhost:1234/app')
assert m.a == 'redis://user:pass@localhost:1234/app'
assert m.a.user == 'user'
assert m.a.password == 'pass'

m = Model(a='rediss://user:pass@localhost:6379/app')
assert m.a == 'rediss://user:pass@localhost:6379/app'
m = Model(a='rediss://user:pass@localhost:1234/app')
assert m.a == 'rediss://user:pass@localhost:1234/app'

m = Model(a='rediss://:pass@localhost:6379')
assert m.a == 'rediss://:pass@localhost:6379/0'
m = Model(a='rediss://:pass@localhost:1234')
assert m.a == 'rediss://:pass@localhost:1234/0'

with pytest.raises(ValidationError) as exc_info:
Model(a='http://example.org')
assert exc_info.value.errors()[0]['type'] == 'value_error.url.scheme'

# Password is not required for Redis protocol
m = Model(a='redis://localhost:6379/app')
assert m.a == 'redis://localhost:6379/app'
m = Model(a='redis://localhost:1234/app')
assert m.a == 'redis://localhost:1234/app'
assert m.a.user is None
assert m.a.password is None

Expand Down

0 comments on commit 2dbbe5b

Please sign in to comment.