def test_create_repo_unsupported(self): """Verify that an unsupported protocol generates a runtime error. """ protocols = [ 'not_a_supported_protocol', ] for protocol in protocols: self._repo[ExternalsDescription.PROTOCOL] = protocol with self.assertRaises(RuntimeError): create_repository(self._name, self._repo)
def test_create_repo_externals_only(self): """Verify that an externals only repo returns None. """ protocols = [ 'externals_only', ] for protocol in protocols: self._repo[ExternalsDescription.PROTOCOL] = protocol repo = create_repository(self._name, self._repo) self.assertEqual(None, repo)
def test_create_repo_svn(self): """Verify that several possible names for the 'svn' protocol create svn repository objects. """ protocols = [ 'svn', 'SVN', 'Svn', ] for protocol in protocols: self._repo[ExternalsDescription.PROTOCOL] = protocol repo = create_repository(self._name, self._repo) self.assertIsInstance(repo, SvnRepository)
def test_create_repo_git(self): """Verify that several possible names for the 'git' protocol create git repository objects. """ protocols = [ 'git', 'GIT', 'Git', ] for protocol in protocols: self._repo[ExternalsDescription.PROTOCOL] = protocol repo = create_repository(self._name, self._repo) self.assertIsInstance(repo, GitRepository)