Esempio n. 1
0
def test_buildpack_update_norev():
    with tmprepo('buildpack_hello.tar.gz', 'git', BuildPack) as r:
        rev = 'd0b1df4838d51c694b6bba9b6c3779a5e2a17775'
        # Unlike the Repo superclass, buildpacks can call .update() without
        # passing in a revision, since we don't want to make users think about
        # buildpack versions if they don't have to.
        r.update()
        assert r.version == rev
Esempio n. 2
0
def test_git_update():
    newrev = '6c79fb7d071a9054542114eea70f69d5361a61ff'
    oldrev = '16c1dba07ee78d5dbee1f965d91d3d61942ccb67'
    with tmprepo('git_python_app.tar.gz', 'git') as r:
        r.update(newrev)
        f = 'newfile'
        assert os.path.isfile(f)

        r.update(oldrev)
        assert not os.path.isfile(f)
Esempio n. 3
0
    def test_hg_update(self):
        newrev = '13b6ce1e234a'
        oldrev = '496e15fd973f'
        with tmprepo('hg_python_app.tar.gz', 'hg') as r:
            r.update(newrev)
            f = 'newfile'
            assert os.path.isfile(f)

            r.update(oldrev)
            assert not os.path.isfile(f)
Esempio n. 4
0
def test_buildpack_update_rev():
    with tmprepo('buildpack_hello.tar.gz', 'git', BuildPack) as r:
        rev = '410a52780f6fd9d10d09d1da54088c03a0e2933f'
        # But passing in a rev needs to be supported still
        r.update(rev)
        assert r.version == rev
Esempio n. 5
0
 def test_hg_get_version(self):
     rev = '496e15fd973f'
     with tmprepo('hg_python_app.tar.gz', 'hg') as r:
         r.update(rev)
         assert r.version == rev
Esempio n. 6
0
 def test_hg_update_norev(self):
     with tmprepo('hg_python_app.tar.gz', 'hg') as r:
         # rev defaults to tip
         r.update()
         assert r.version == '802efadda217'
Esempio n. 7
0
 def test_diverged_branch(self):
     with tmprepo('git_python_app.tar.gz', 'git') as r:
         _git_config()
         r.update('master')
         assert r.version.startswith('9913c8a')
Esempio n. 8
0
 def test_git_detached_tag(self):
     with tmprepo('git_python_app.tar.gz', 'git') as r:
         _git_config()
         r.update('detached-tag')
         assert r.version.startswith('1418411')
Esempio n. 9
0
 def test_git_get_short_version(self):
     rev = '16c1dba07'
     with tmprepo('git_python_app.tar.gz', 'git') as r:
         _git_config()
         r.update(rev)
         assert r.version.startswith(rev)
Esempio n. 10
0
 def test_git_get_version(self):
     rev = '16c1dba07ee78d5dbee1f965d91d3d61942ccb67'
     with tmprepo('git_python_app.tar.gz', 'git') as r:
         _git_config()
         r.update(rev)
         assert r.version == rev
Esempio n. 11
0
def test_update_norev():
    with tmprepo('hg_python_app.tar.gz', 'hg') as r:
        # repo.update requires passing a revision
        with pytest.raises(TypeError):
            r.update()