]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/t/tclient.py
Simplify bup startup process
[bup.git] / lib / bup / t / tclient.py
index 4a3147cf3833217c64fa40b7494bc7832f33f811..284effccda49280b1102311b9e7bcb8efe60255b 100644 (file)
@@ -1,9 +1,10 @@
 
+from __future__ import absolute_import
 import sys, os, stat, time, random, subprocess, glob
 
 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
 
@@ -26,7 +27,6 @@ IDX_PAT = '/*.idx'
 def test_server_split_with_indexes():
     with no_lingering_errors():
         with test_tempdir('bup-tclient-') as tmpdir:
-            os.environ['BUP_MAIN_EXE'] = '../../../bup'
             os.environ['BUP_DIR'] = bupdir = tmpdir
             git.init_repo(bupdir)
             lw = git.PackWriter()
@@ -46,7 +46,6 @@ def test_server_split_with_indexes():
 def test_multiple_suggestions():
     with no_lingering_errors():
         with test_tempdir('bup-tclient-') as tmpdir:
-            os.environ['BUP_MAIN_EXE'] = '../../../bup'
             os.environ['BUP_DIR'] = bupdir = tmpdir
             git.init_repo(bupdir)
 
@@ -82,7 +81,6 @@ def test_multiple_suggestions():
 def test_dumb_client_server():
     with no_lingering_errors():
         with test_tempdir('bup-tclient-') as tmpdir:
-            os.environ['BUP_MAIN_EXE'] = '../../../bup'
             os.environ['BUP_DIR'] = bupdir = tmpdir
             git.init_repo(bupdir)
             open(git.repo('bup-dumb-server'), 'w').close()
@@ -105,7 +103,6 @@ def test_dumb_client_server():
 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)
@@ -132,7 +129,7 @@ def test_midx_refreshing():
             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)