def test_regex_https(): line ='origin https://github.com/danvk/git-helpers.git (push)' remote = Remote.parse_line(line) assert remote assert remote.name == 'origin' assert remote.host == 'github.com' assert remote.path == 'danvk/git-helpers.git'
def test_regex_ssh(): line ='origin [email protected]:danvk/expandable-image-grid.git (push)' remote = Remote.parse_line(line) assert remote assert remote.name == 'origin' assert remote.host == 'github.com' assert remote.path == 'danvk/expandable-image-grid.git' assert remote.user == 'git'