def test_hg(self): repo_url = "ssh://[email protected]/pydanny/static" self.assertEqual(identify_vcs(repo_url), "hg") repo_url = "http://bitbucket.org/pydanny/static" with self.assertRaises(UnknownVCS): identify_vcs(repo_url) self.assertEqual(identify_vcs(repo_url, guess=True), "hg") repo_url = "https://[email protected]/pydanny/static" self.assertEqual(identify_vcs(repo_url, guess=True), "hg")
def test_svn(self): # easy check repo_url = "http://svn.code.sf.net/p/docutils/code/trunk" self.assertEqual(identify_vcs(repo_url), "svn") # Throw an error because it can't find the Repo host repo_url = "docutils.svn.sourceforge.net" with self.assertRaises(UnknownVCS): identify_vcs(repo_url) # make a guess self.assertEqual(identify_vcs(repo_url, guess=True), "svn")
def test_custom(self): repo_aliases = tuple(list(REPO_ALIASES) + ['bzr']) repo_url = "http://bzr.example.com/" self.assertEqual( identify_vcs(repo_url, guess=True, repo_aliases=repo_aliases), "bzr")
def test_git(self): repo_url = "[email protected]:pydanny/watdarepo.git" self.assertEqual(identify_vcs(repo_url), "git") repo_url = "https://github.com/pydanny/watdarepo.git" self.assertEqual(identify_vcs(repo_url), "git")
def test_custom(self): repo_aliases = tuple(list(REPO_ALIASES) + ['bzr']) repo_url = "http://bzr.example.com/" self.assertEqual(identify_vcs(repo_url, guess=True, repo_aliases=repo_aliases), "bzr")