server: Allow a server address with a subpath.
This commit is contained in:
parent
54ad615431
commit
107a7a606e
2 changed files with 44 additions and 1 deletions
19
tests/server_test.py
Normal file
19
tests/server_test.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
from matrix.server import MatrixServer
|
||||
from matrix._weechat import MockConfig
|
||||
import matrix.globals as G
|
||||
|
||||
G.CONFIG = MockConfig()
|
||||
|
||||
class TestClass(object):
|
||||
def test_address_parsing(self):
|
||||
host = MatrixServer._parse_url("example.org", "443")
|
||||
assert host == "example.org:443"
|
||||
|
||||
host = MatrixServer._parse_url("example.org/_matrix", "443")
|
||||
assert host == "example.org:443/_matrix"
|
||||
|
||||
host = MatrixServer._parse_url("https://example.org/_matrix", "443")
|
||||
assert host == "example.org:443/_matrix"
|
||||
|
||||
host = MatrixServer._parse_url("https://example.org", "443")
|
||||
assert host == "example.org:443"
|
||||
Loading…
Add table
Add a link
Reference in a new issue