From 2758ece4a91a59e7390cc00faf9e965a2ec16405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 3 Jul 2019 21:20:07 +0200 Subject: [PATCH] tests: Fix server tests. --- tests/server_test.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/tests/server_test.py b/tests/server_test.py index 764c19a..ceb94fb 100644 --- a/tests/server_test.py +++ b/tests/server_test.py @@ -6,20 +6,16 @@ G.CONFIG = MockConfig() class TestClass(object): def test_address_parsing(self): - host, extra_path = MatrixServer._parse_url("example.org") - assert host == "example.org" - assert extra_path == "" + homeserver = MatrixServer._parse_url("example.org", 8080) + assert homeserver.hostname == "example.org" + assert homeserver.geturl() == "https://example.org:8080" - host, extra_path = MatrixServer._parse_url("example.org/_matrix") - assert host == "example.org" - assert extra_path == "_matrix" + homeserver = MatrixServer._parse_url("example.org/_matrix", 80) + assert homeserver.hostname == "example.org" + assert homeserver.geturl() == "https://example.org:80/_matrix" - host, extra_path = MatrixServer._parse_url( - "https://example.org/_matrix" + homeserver = MatrixServer._parse_url( + "https://example.org/_matrix", 80 ) - assert host == "example.org" - assert extra_path == "_matrix" - - host, extra_path = MatrixServer._parse_url("https://example.org") - assert host == "example.org" - assert extra_path == "" + assert homeserver.hostname == "example.org" + assert homeserver.geturl() == "https://example.org:80/_matrix"