Skip to content

Commit 131a8be

Browse files
Michael Russellguyzmo
authored andcommitted
Add test for the ".git" in repo url bug.
1 parent d489a11 commit 131a8be

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/integration/test_main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,17 @@ def test_request_list__no_repo_slug__https(self, capsys, caplog):
329329
assert out == ' 1\tdesc1 \thttp://request/1\n 2\tdesc2 \thttp://request/2\n 3\tdesc3 \thttp://request/3\n'
330330
assert 'id' in caplog.text and 'title' in caplog.text and 'URL' in caplog.text
331331

332+
def test_request_list__no_repo_slug__https_dot_git(self, capsys, caplog):
333+
from subprocess import call
334+
call(['git', 'init', '-q', self.tempdir.name])
335+
call(['git', '--git-dir={}/.git'.format(self.tempdir.name), 'remote', 'add', 'github', 'https://github.com/guyzmo/.git-repo'])
336+
repo_slug, seen_args = self.main_request_list(rc=0, args={})
337+
assert ('guyzmo', '.git-repo') == repo_slug
338+
assert dict() == seen_args
339+
out, err = capsys.readouterr()
340+
assert out == ' 1\tdesc1 \thttp://request/1\n 2\tdesc2 \thttp://request/2\n 3\tdesc3 \thttp://request/3\n'
341+
assert 'id' in caplog.text and 'title' in caplog.text and 'URL' in caplog.text
342+
332343
def test_request_fetch__request(self, capsys, caplog):
333344
from subprocess import call
334345
call(['git', 'init', '-q', self.tempdir.name])

0 commit comments

Comments
 (0)