예제 #1
0
    def test_forks_have_precedence_over_principal_order(self):
        bottom_repo = Repository('bottom/the.repo')
        top_repo = Repository('top/the.repo', parent=bottom_repo)

        self.stub_repositories(top_repo, bottom_repo)
        self.replay()

        result = update({'organisations': ['top', 'bottom']})

        self.maxDiff = None
        self.assertMultiLineEqual(
            '''[buildout]
auto-checkout =
sources = sources
github-cloneurl = ${buildout:github-https}
github-pushurl = ${buildout:github-ssh}


github-https = https://github.com/
github-ssh = [email protected]:
github-git = git://github.com/


[branches]
the.repo = master


[forks]
the.repo = bottom


[sources]
the.repo = git ${buildout:github-cloneurl}${forks:the.repo}/the.repo.git pushurl=${buildout:github-pushurl}${forks:the.repo}/the.repo.git branch=${branches:the.repo}
''',
            result)
예제 #2
0
    def test_empty_repository_is_skipped(self):
        # empty repositories are those which have no master branch
        self.stub_repositories(
            Repository('foo/foo', master_branch=None),
            Repository('bar/bar', master_branch=None))
        self.replay()

        result = update({'organisations': ['foo'],
                         'repos': ['bar/bar']})

        self.maxDiff = None
        self.assertMultiLineEqual(
            '''[buildout]
auto-checkout =
sources = sources
github-cloneurl = ${buildout:github-https}
github-pushurl = ${buildout:github-ssh}


github-https = https://github.com/
github-ssh = [email protected]:
github-git = git://github.com/


[branches]


[forks]


[sources]
''',

            result)
예제 #3
0
    def test_top_organisations_have_precedence(self):
        self.stub_repositories(
            Repository('foo/foo'),
            Repository('foo/bar'),
            Repository('bar/bar'),
            Repository('bar/baz'))
        self.replay()

        result = update({'organisations': ['foo', 'bar']})

        self.maxDiff = None
        self.assertMultiLineEqual(
            '''[buildout]
auto-checkout =
sources = sources
github-cloneurl = ${buildout:github-https}
github-pushurl = ${buildout:github-ssh}


github-https = https://github.com/
github-ssh = [email protected]:
github-git = git://github.com/


[branches]
bar = master
baz = master
foo = master


[forks]
bar = foo
baz = bar
foo = foo


[sources]
bar = git ${buildout:github-cloneurl}${forks:bar}/bar.git pushurl=${buildout:github-pushurl}${forks:bar}/bar.git branch=${branches:bar}
baz = git ${buildout:github-cloneurl}${forks:baz}/baz.git pushurl=${buildout:github-pushurl}${forks:baz}/baz.git branch=${branches:baz}
foo = git ${buildout:github-cloneurl}${forks:foo}/foo.git pushurl=${buildout:github-pushurl}${forks:foo}/foo.git branch=${branches:foo}
''',

            result)
예제 #4
0
    def test_contains_all_principal_repositories(self):
        self.stub_repositories(
            Repository('foo/foo.bar'),
            Repository('foo/foo.baz'))
        self.replay()

        result = update({'organisations': ['foo']})

        self.maxDiff = None
        self.assertMultiLineEqual(
            '''[buildout]
auto-checkout =
sources = sources
github-cloneurl = ${buildout:github-https}
github-pushurl = ${buildout:github-ssh}


github-https = https://github.com/
github-ssh = [email protected]:
github-git = git://github.com/


[branches]
foo.bar = master
foo.baz = master


[forks]
foo.bar = foo
foo.baz = foo


[sources]
foo.bar = git ${buildout:github-cloneurl}${forks:foo.bar}/foo.bar.git pushurl=${buildout:github-pushurl}${forks:foo.bar}/foo.bar.git branch=${branches:foo.bar}
foo.baz = git ${buildout:github-cloneurl}${forks:foo.baz}/foo.baz.git pushurl=${buildout:github-pushurl}${forks:foo.baz}/foo.baz.git branch=${branches:foo.baz}
''',

            result,
            'The sources.cfg should exactly contain the repositories foo/foo.bar'
            ' and foo/foo.baz.')
예제 #5
0
    def test_single_repositories_have_precendence(self):
        self.stub_repositories(
            Repository('foo/the-repo'),
            Repository('foo/another'),
            Repository('bar/the-repo'))
        self.replay()

        result = update({'organisations': ['foo'],
                         'repos': ['bar/the-repo']})

        self.maxDiff = None
        self.assertMultiLineEqual(
            '''[buildout]
auto-checkout =
sources = sources
github-cloneurl = ${buildout:github-https}
github-pushurl = ${buildout:github-ssh}


github-https = https://github.com/
github-ssh = [email protected]:
github-git = git://github.com/


[branches]
another = master
the-repo = master


[forks]
another = foo
the-repo = bar


[sources]
another = git ${buildout:github-cloneurl}${forks:another}/another.git pushurl=${buildout:github-pushurl}${forks:another}/another.git branch=${branches:another}
the-repo = git ${buildout:github-cloneurl}${forks:the-repo}/the-repo.git pushurl=${buildout:github-pushurl}${forks:the-repo}/the-repo.git branch=${branches:the-repo}
''',

            result)
예제 #6
0
    def test_single_repos(self):
        self.stub_repositories(
            Repository('foo/foo.bar'),
            Repository('foo/foo.baz'))
        self.replay()

        result = update({'repos': ['foo/foo.bar', 'foo/foo.baz']})

        self.maxDiff = None
        self.assertMultiLineEqual(
            '''[buildout]
auto-checkout =
sources = sources
github-cloneurl = ${buildout:github-https}
github-pushurl = ${buildout:github-ssh}


github-https = https://github.com/
github-ssh = [email protected]:
github-git = git://github.com/


[branches]
foo.bar = master
foo.baz = master


[forks]
foo.bar = foo
foo.baz = foo


[sources]
foo.bar = git ${buildout:github-cloneurl}${forks:foo.bar}/foo.bar.git pushurl=${buildout:github-pushurl}${forks:foo.bar}/foo.bar.git branch=${branches:foo.bar}
foo.baz = git ${buildout:github-cloneurl}${forks:foo.baz}/foo.baz.git pushurl=${buildout:github-pushurl}${forks:foo.baz}/foo.baz.git branch=${branches:foo.baz}
''',

            result)
예제 #7
0
    def test_forks_can_be_used_by_defining_it_explictily(self):
        original = Repository('organisation/the.repo')
        fork = Repository('john.doe/the.repo', parent=original)

        self.stub_repositories(original, fork)
        self.replay()

        result = update({'organisations': ['john.doe'],
                         'repos': ['john.doe/the.repo']})

        self.maxDiff = None
        self.assertMultiLineEqual(
            '''[buildout]
auto-checkout =
sources = sources
github-cloneurl = ${buildout:github-https}
github-pushurl = ${buildout:github-ssh}


github-https = https://github.com/
github-ssh = [email protected]:
github-git = git://github.com/


[branches]
the.repo = master


[forks]
the.repo = john.doe


[sources]
the.repo = git ${buildout:github-cloneurl}${forks:the.repo}/the.repo.git pushurl=${buildout:github-pushurl}${forks:the.repo}/the.repo.git branch=${branches:the.repo}
''',
            result)
예제 #8
0
    def test_forks_should_be_followed_recursively(self):
        original = Repository('organisation/the.repo')
        first_fork = Repository('john.doe/the.repo', parent=original)
        second_fork = Repository('peter.griffin/the.repo', parent=first_fork)

        self.stub_repositories(original, first_fork, second_fork)
        self.replay()

        result = update({'organisations': ['peter.griffin']})

        self.maxDiff = None
        self.assertMultiLineEqual(
            '''[buildout]
auto-checkout =
sources = sources
github-cloneurl = ${buildout:github-https}
github-pushurl = ${buildout:github-ssh}


github-https = https://github.com/
github-ssh = [email protected]:
github-git = git://github.com/


[branches]
the.repo = master


[forks]
the.repo = organisation


[sources]
the.repo = git ${buildout:github-cloneurl}${forks:the.repo}/the.repo.git pushurl=${buildout:github-pushurl}${forks:the.repo}/the.repo.git branch=${branches:the.repo}
''',
            result)
예제 #9
0
    def test_forks_where_parent_was_deleted_are_included(self):
        self.stub_repositories(
            Repository('foo/foo.bar', fork=True))
        self.replay()

        result = update({'organisations': ['foo']})

        self.maxDiff = None
        self.assertMultiLineEqual(
            '''[buildout]
auto-checkout =
sources = sources
github-cloneurl = ${buildout:github-https}
github-pushurl = ${buildout:github-ssh}


github-https = https://github.com/
github-ssh = [email protected]:
github-git = git://github.com/


[branches]
foo.bar = master


[forks]
foo.bar = foo


[sources]
foo.bar = git ${buildout:github-cloneurl}${forks:foo.bar}/foo.bar.git pushurl=${buildout:github-pushurl}${forks:foo.bar}/foo.bar.git branch=${branches:foo.bar}
''',

            result,
            'The sources.cfg should exactly contain the repositories'
            ' foo/foo.bar')