tests: Fix server tests.
This commit is contained in:
parent
934863e209
commit
2758ece4a9
1 changed files with 10 additions and 14 deletions
|
@ -6,20 +6,16 @@ G.CONFIG = MockConfig()
|
||||||
|
|
||||||
class TestClass(object):
|
class TestClass(object):
|
||||||
def test_address_parsing(self):
|
def test_address_parsing(self):
|
||||||
host, extra_path = MatrixServer._parse_url("example.org")
|
homeserver = MatrixServer._parse_url("example.org", 8080)
|
||||||
assert host == "example.org"
|
assert homeserver.hostname == "example.org"
|
||||||
assert extra_path == ""
|
assert homeserver.geturl() == "https://example.org:8080"
|
||||||
|
|
||||||
host, extra_path = MatrixServer._parse_url("example.org/_matrix")
|
homeserver = MatrixServer._parse_url("example.org/_matrix", 80)
|
||||||
assert host == "example.org"
|
assert homeserver.hostname == "example.org"
|
||||||
assert extra_path == "_matrix"
|
assert homeserver.geturl() == "https://example.org:80/_matrix"
|
||||||
|
|
||||||
host, extra_path = MatrixServer._parse_url(
|
homeserver = MatrixServer._parse_url(
|
||||||
"https://example.org/_matrix"
|
"https://example.org/_matrix", 80
|
||||||
)
|
)
|
||||||
assert host == "example.org"
|
assert homeserver.hostname == "example.org"
|
||||||
assert extra_path == "_matrix"
|
assert homeserver.geturl() == "https://example.org:80/_matrix"
|
||||||
|
|
||||||
host, extra_path = MatrixServer._parse_url("https://example.org")
|
|
||||||
assert host == "example.org"
|
|
||||||
assert extra_path == ""
|
|
||||||
|
|
Loading…
Reference in a new issue