diff options
author | Daniel Silverstone (br7vm) <daniel.silverstone@codethink.co.uk> | 2013-05-28 16:10:17 +0000 |
---|---|---|
committer | Daniel Silverstone (br7vm) <daniel.silverstone@codethink.co.uk> | 2013-05-28 16:10:17 +0000 |
commit | ad28474a0334e60e9036050c625b4a2341f33462 (patch) | |
tree | fd6b214cae54c24e539505587cd4f01a33150544 /morphlib/repoaliasresolver_tests.py | |
parent | 5df056c4c06f2a74ed4d5ee965c5bcf237295c58 (diff) | |
download | morph-ad28474a0334e60e9036050c625b4a2341f33462.tar.gz |
REPOALIAS: Update repo alias to support dashes and to be more strict.
Now, repo aliases must meet [a-z][a-z0-9-]+ rather than just [a-z0-9]+
Diffstat (limited to 'morphlib/repoaliasresolver_tests.py')
-rw-r--r-- | morphlib/repoaliasresolver_tests.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/morphlib/repoaliasresolver_tests.py b/morphlib/repoaliasresolver_tests.py index 8e1827d7..c4ea16b0 100644 --- a/morphlib/repoaliasresolver_tests.py +++ b/morphlib/repoaliasresolver_tests.py @@ -33,6 +33,9 @@ class RepoAliasResolverTests(unittest.TestCase): ('append=' 'git://append/#' 'git@append/'), + ('footrove-01=' + 'git://footrove.machine/%s#' + 'ssh://git@footrove.machine/%s.git'), ] self.resolver = morphlib.repoaliasresolver.RepoAliasResolver( self.aliases) @@ -66,6 +69,12 @@ class RepoAliasResolverTests(unittest.TestCase): url = self.resolver.push_url('baserock:bar') self.assertEqual(url, 'git@gitorious.org:baserock/bar.git') + def test_resolve_urls_for_alias_with_dash(self): + url = self.resolver.pull_url('footrove-01:baz') + self.assertEqual(url, 'git://footrove.machine/baz') + url = self.resolver.push_url('footrove-01:baz') + self.assertEqual(url, 'ssh://git@footrove.machine/baz.git') + def test_resolve_urls_for_unknown_alias(self): self.assertEqual(self.resolver.pull_url('unknown:foo'), 'unknown:foo') self.assertEqual(self.resolver.push_url('unknown:foo'), 'unknown:foo') |