46:0f45e02848a1
Anton Shestakov <av6@dwimlabs.net>, Sun, 19 Jun 2016 16:22:28 +0800
models: add Project.get_title() method, use it, test it

next change 50:8194291e98bc
previous change 45:d120981c4310

tests/test_incoming.py

Permissions: -rw-r--r--

Other formats: Feeds:
from incoming import parse_project_url
def test_parse_project_url():
result = parse_project_url('https://example.com/alice/hello-world')
assert result == ('example.com', 'alice', 'hello-world')
result = parse_project_url('~alice/hello-world')
assert result == ('self', '~alice', 'hello-world')
result = parse_project_url('https://code.example.com/hello-world')
assert result == ('code.example.com', None, 'hello-world')
result = parse_project_url('https://example.com/scm/projects/hello-world')
assert result == ('example.com', 'scm', 'projects/hello-world')
result = parse_project_url('https://example.com///hello-world//')
assert result == ('example.com', None, 'hello-world')