예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
    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)