def test_version_info(monkeypatch): dir = tempfile.mkdtemp() monkeypatch.chdir(dir) with open('version-info.txt', 'wb') as f: f.write(b'1\n') rev = revision.load_revision() assert rev == '1'
def test_bzr_version_info_py2(monkeypatch): dir = tempfile.mkdtemp() monkeypatch.chdir(dir) monkeypatch.syspath_prepend(dir) set_up_bzr() vinfo = run(['bzr', 'version-info', '--format=python']) with open('versioninfo.py', 'wb') as f: f.write(vinfo) rev = revision.load_revision() assert rev == '1'
def test_git(monkeypatch): dir = tempfile.mkdtemp() monkeypatch.chdir(dir) run(['git', 'init', '.']) run(['git', 'config', 'user.email', '*****@*****.**']) run(['git', 'config', 'user.name', 'someone']) run(['touch', 'foo']) run(['git', 'add', 'foo']) run(['git', 'commit', '-m', 'init']) rev = revision.load_revision() assert len(rev) == 40
def test_bzr(monkeypatch): dir = tempfile.mkdtemp() monkeypatch.chdir(dir) set_up_bzr() rev = revision.load_revision() assert rev == '1'