from wvtest import *
-from bup import client, git
+from bup import client, git, path
from bup.helpers import mkdirp
from buptest import no_lingering_errors, test_tempdir
return s
-top_dir = os.path.realpath('../../..')
-bup_exe = top_dir + '/cmd/bup'
-
s1 = randbytes(10000)
s2 = randbytes(10000)
s3 = randbytes(10000)
def test_server_split_with_indexes():
with no_lingering_errors():
with test_tempdir('bup-tclient-') as tmpdir:
- os.environ['BUP_MAIN_EXE'] = bup_exe
os.environ['BUP_DIR'] = bupdir = tmpdir
git.init_repo(bupdir)
lw = git.PackWriter()
def test_multiple_suggestions():
with no_lingering_errors():
with test_tempdir('bup-tclient-') as tmpdir:
- os.environ['BUP_MAIN_EXE'] = bup_exe
os.environ['BUP_DIR'] = bupdir = tmpdir
git.init_repo(bupdir)
def test_dumb_client_server():
with no_lingering_errors():
with test_tempdir('bup-tclient-') as tmpdir:
- os.environ['BUP_MAIN_EXE'] = bup_exe
os.environ['BUP_DIR'] = bupdir = tmpdir
git.init_repo(bupdir)
open(git.repo('bup-dumb-server'), 'w').close()
def test_midx_refreshing():
with no_lingering_errors():
with test_tempdir('bup-tclient-') as tmpdir:
- os.environ['BUP_MAIN_EXE'] = bupmain = '../../../bup'
os.environ['BUP_DIR'] = bupdir = tmpdir
git.init_repo(bupdir)
c = client.Client(bupdir, create=True)
WVFAIL(p2.exists(s1sha))
WVPASS(p2.exists(s2sha))
- subprocess.call([bupmain, 'midx', '-f'])
+ subprocess.call([path.exe(), 'midx', '-f'])
pi.refresh()
WVPASSEQ(len(pi.packs), 1)
pi.refresh(skip_midx=True)