mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-13 16:29:49 +08:00
Test that we can clone repos with a trailing slash.
This commit is contained in:
@@ -63,6 +63,8 @@ class SCM(object):
|
||||
raise Unauthorized(
|
||||
'%s is not in the list of allowed SCMs' % url)
|
||||
|
||||
url = url.rstrip('/')
|
||||
|
||||
self.url = url
|
||||
|
||||
# once we have more than one SCM provider, we will need some more
|
||||
|
||||
@@ -65,3 +65,13 @@ class TestSCMModule(unittest.TestCase):
|
||||
fname = tempfile.mktemp(suffix='mbs-scm-test')
|
||||
scm.get_latest(branch='master; touch %s' % fname)
|
||||
assert not os.path.exists(fname), "%r exists! Vulnerable." % fname
|
||||
|
||||
def test_local_extract_name(self):
|
||||
scm = module_build_service.scm.SCM(repo_path)
|
||||
target = 'testrepo'
|
||||
assert scm.name == target, '%r != %r' % (scm.name, target)
|
||||
|
||||
def test_local_extract_name_trailing_slash(self):
|
||||
scm = module_build_service.scm.SCM(repo_path + '/')
|
||||
target = 'testrepo'
|
||||
assert scm.name == target, '%r != %r' % (scm.name, target)
|
||||
|
||||
Reference in New Issue
Block a user