Resolve usernames when the remote ends with a trailing slash by AA-Turner · Pull Request #110 · python/cherry-picker

@pytest.mark.parametrize(
"url",
[
b"git@github.com:mock_user/cpython.git",
b"git@github.com:mock_user/cpython",
b"ssh://git@github.com/mock_user/cpython.git",
b"ssh://git@github.com/mock_user/cpython",
b"https://github.com/mock_user/cpython.git",
b"https://github.com/mock_user/cpython",
],
)
def test_username(url, config):
branches = ["3.6"]
cp = CherryPicker(
"origin", "22a594a0047d7706537ff2ac676cdc0f1dcb329c", branches, config=config
)
with mock.patch("subprocess.check_output", return_value=url):
assert cp.username == "mock_user"