Move remaining util tests into pytest
This commit is contained in:
parent
fa354d695a
commit
69406c6aec
4 changed files with 198 additions and 226 deletions
20
util/test/test_util.py
Normal file
20
util/test/test_util.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
import pytest
|
||||
|
||||
from util import slash_join
|
||||
|
||||
@pytest.mark.parametrize('pieces, expected', [
|
||||
(['https://github.com', '/coreos-inc/' 'quay/pull/1092/files'],
|
||||
'https://github.com/coreos-inc/quay/pull/1092/files'),
|
||||
|
||||
(['https://', 'github.com/', '/coreos-inc', '/quay/pull/1092/files/'],
|
||||
'https://github.com/coreos-inc/quay/pull/1092/files'),
|
||||
|
||||
(['https://somegithub.com/', '/api/v3/'],
|
||||
'https://somegithub.com/api/v3'),
|
||||
|
||||
(['https://github.somedomain.com/', '/api/v3/'],
|
||||
'https://github.somedomain.com/api/v3'),
|
||||
])
|
||||
def test_slash_join(pieces, expected):
|
||||
joined_url = slash_join(*pieces)
|
||||
assert joined_url == expected
|
Reference in a new issue