Example #1
0
    def test_get_repo_directory_removes_colon_from_directory_if_exists(self):
        Configuration['repo_directory'] = '/tmp/repos'
        git = Git("some_remote_value", 'origin', 'ref/to/some/branch')

        repo_directory = git.get_full_repo_directory('ssh://source_control.cr.com:1234/master')

        self.assertEqual(repo_directory, '/tmp/repos/source_control.cr.com1234/master')
Example #2
0
    def test_get_repo_directory_removes_colon_from_directory_if_exists(self):
        Configuration['repo_directory'] = '/tmp/repos'
        git = Git("some_remote_value", 'origin', 'ref/to/some/branch')

        repo_directory = git.get_full_repo_directory('ssh://source_control.cr.com:1234/master')

        self.assertEqual(repo_directory, '/tmp/repos/source_control.cr.com1234/master')
Example #3
0
    def test_get_full_repo_directory(self):
        Configuration['repo_directory'] = '/home/cr_user/.clusterrunner/repos/master'
        url = 'http://scm.example.com/path/to/project'

        repo_path = Git.get_full_repo_directory(url)

        self.assertEqual(repo_path, '/home/cr_user/.clusterrunner/repos/master/scm.example.com/path/to/project')
Example #4
0
    def test_get_full_repo_directory(self):
        Configuration['repo_directory'] = '/home/cr_user/.clusterrunner/repos/master'
        url = 'http://scm.example.com/path/to/project'

        repo_path = Git.get_full_repo_directory(url)

        self.assertEqual(repo_path, '/home/cr_user/.clusterrunner/repos/master/scm.example.com/path/to/project')
Example #5
0
    def test_get_full_repo_directory(self, url, expected_repo_path_without_base):
        Configuration['repo_directory'] = join(expanduser('~'), '.clusterrunner', 'repos')
        expected_repo_path = join(
            Configuration['repo_directory'], 
            expected_repo_path_without_base,
        )

        actual_repo_path = Git.get_full_repo_directory(url)
        self.assertEqual(expected_repo_path, actual_repo_path)
    def test_get_repo_directory_removes_colon_from_directory_if_exists(self):
        Configuration['repo_directory'] = join(expanduser('~'), 'tmp', 'repos')
        git = Git("some_remote_value", 'origin', 'ref/to/some/branch')

        actual_repo_directory = git.get_full_repo_directory(
            'ssh://source_control.cr.com:1234/master')
        expected_repo_directory = join(Configuration['repo_directory'],
                                       'source_control.cr.com1234', 'master')

        self.assertEqual(expected_repo_directory, actual_repo_directory)
    def test_get_full_repo_directory(self, url,
                                     expected_repo_path_without_base):
        Configuration['repo_directory'] = join(expanduser('~'),
                                               '.clusterrunner', 'repos')
        expected_repo_path = join(
            Configuration['repo_directory'],
            expected_repo_path_without_base,
        )

        actual_repo_path = Git.get_full_repo_directory(url)
        self.assertEqual(expected_repo_path, actual_repo_path)
Example #8
0
    def test_get_repo_directory_removes_colon_from_directory_if_exists(self):
        Configuration['repo_directory'] = join(expanduser('~'), 'tmp', 'repos')
        git = Git("some_remote_value", 'origin', 'ref/to/some/branch')

        actual_repo_directory = git.get_full_repo_directory('ssh://source_control.cr.com:1234/master')
        expected_repo_directory = join(
            Configuration['repo_directory'],
            'source_control.cr.com1234',
            'master'
        )

        self.assertEqual(expected_repo_directory, actual_repo_directory)
Example #9
0
    def test_get_full_repo_directory(self):
        Configuration['repo_directory'] = join(expanduser('~'), '.clusterrunner', 'repos')
        url = 'http://scm.example.com/path/to/project'

        actual_repo_sys_path = Git.get_full_repo_directory(url)

        expected_repo_sys_path = join(
            Configuration['repo_directory'],
            'scm.example.com',
            'path',
            'to',
            'project',
        )
        self.assertEqual(expected_repo_sys_path, actual_repo_sys_path)
Example #10
0
    def test_get_full_repo_directory(self):
        Configuration['repo_directory'] = join(expanduser('~'), '.clusterrunner', 'repos')
        url = 'http://scm.example.com/path/to/project'

        actual_repo_sys_path = Git.get_full_repo_directory(url)

        expected_repo_sys_path = join(
            Configuration['repo_directory'],
            'scm.example.com',
            'path',
            'to',
            'project',
        )
        self.assertEqual(expected_repo_sys_path, actual_repo_sys_path)