From 7e7405d32f7f0a1570c8524e936b168adab03661 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Wed, 14 Jul 2010 02:59:03 -0400 Subject: [PATCH] Move t/*.py to lib/bup/t/*.py. Since the tests in that directory are all tests of lib/bup/*.py anyway, this is a more consistent location for them. Signed-off-by: Avery Pennarun --- Makefile | 2 +- lib/__init__.py | 0 lib/bup/t/__init__.py | 2 ++ {t => lib/bup/t}/tclient.py | 5 ++--- {t => lib/bup/t}/tgit.py | 0 {t => lib/bup/t}/thelpers.py | 0 {t => lib/bup/t}/tindex.py | 12 ++++++------ {t => lib/bup/t}/toptions.py | 0 {t => lib/bup/t}/tshquote.py | 0 t/__init__.py | 2 -- 10 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 lib/__init__.py create mode 100644 lib/bup/t/__init__.py rename {t => lib/bup/t}/tclient.py (91%) rename {t => lib/bup/t}/tgit.py (100%) rename {t => lib/bup/t}/thelpers.py (100%) rename {t => lib/bup/t}/tindex.py (88%) rename {t => lib/bup/t}/toptions.py (100%) rename {t => lib/bup/t}/tshquote.py (100%) delete mode 100644 t/__init__.py diff --git a/Makefile b/Makefile index 2628730..d12fc39 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ lib/bup/_version.py: runtests: all runtests-python runtests-cmdline runtests-python: - $(PYTHON) wvtest.py $(wildcard t/t*.py) + $(PYTHON) wvtest.py $(wildcard t/t*.py lib/*/t/t*.py) runtests-cmdline: all t/test.sh diff --git a/lib/__init__.py b/lib/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/bup/t/__init__.py b/lib/bup/t/__init__.py new file mode 100644 index 0000000..172f040 --- /dev/null +++ b/lib/bup/t/__init__.py @@ -0,0 +1,2 @@ +import sys +sys.path[:0] = ['../..'] diff --git a/t/tclient.py b/lib/bup/t/tclient.py similarity index 91% rename from t/tclient.py rename to lib/bup/t/tclient.py index d6f236a..4a409a0 100644 --- a/t/tclient.py +++ b/lib/bup/t/tclient.py @@ -1,5 +1,4 @@ import sys, os, time, random, subprocess -sys.path.append('../lib') from bup import client, git, hashsplit from wvtest import * @@ -14,7 +13,7 @@ s2 = randbytes(10000) @wvtest def test_server_split_with_indexes(): - os.environ['BUP_MAIN_EXE'] = '../bup' + os.environ['BUP_MAIN_EXE'] = '../../../bup' os.environ['BUP_DIR'] = bupdir = 'buptest_tclient.tmp' subprocess.call(['rm', '-rf', bupdir]) git.init_repo(bupdir) @@ -32,7 +31,7 @@ def test_server_split_with_indexes(): @wvtest def test_midx_refreshing(): - os.environ['BUP_MAIN_EXE'] = bupmain = '../bup' + os.environ['BUP_MAIN_EXE'] = bupmain = '../../../bup' os.environ['BUP_DIR'] = bupdir = 'buptest_tmidx.tmp' subprocess.call(['rm', '-rf', bupdir]) git.init_repo(bupdir) diff --git a/t/tgit.py b/lib/bup/t/tgit.py similarity index 100% rename from t/tgit.py rename to lib/bup/t/tgit.py diff --git a/t/thelpers.py b/lib/bup/t/thelpers.py similarity index 100% rename from t/thelpers.py rename to lib/bup/t/thelpers.py diff --git a/t/tindex.py b/lib/bup/t/tindex.py similarity index 88% rename from t/tindex.py rename to lib/bup/t/tindex.py index d237757..1fee408 100644 --- a/t/tindex.py +++ b/lib/bup/t/tindex.py @@ -5,13 +5,13 @@ from wvtest import * @wvtest def index_basic(): - cd = os.path.realpath('') + cd = os.path.realpath('../../../t') WVPASS(cd) - sd = os.path.realpath('sampledata') - WVPASSEQ(index.realpath('sampledata'), cd + '/sampledata') - WVPASSEQ(os.path.realpath('sampledata/x'), sd + '/x') - WVPASSEQ(os.path.realpath('sampledata/etc'), os.path.realpath('/etc')) - WVPASSEQ(index.realpath('sampledata/etc'), sd + '/etc') + sd = os.path.realpath(cd + '/sampledata') + WVPASSEQ(index.realpath(cd + '/sampledata'), cd + '/sampledata') + WVPASSEQ(os.path.realpath(cd + '/sampledata/x'), sd + '/x') + WVPASSEQ(os.path.realpath(cd + '/sampledata/etc'), os.path.realpath('/etc')) + WVPASSEQ(index.realpath(cd + '/sampledata/etc'), sd + '/etc') @wvtest diff --git a/t/toptions.py b/lib/bup/t/toptions.py similarity index 100% rename from t/toptions.py rename to lib/bup/t/toptions.py diff --git a/t/tshquote.py b/lib/bup/t/tshquote.py similarity index 100% rename from t/tshquote.py rename to lib/bup/t/tshquote.py diff --git a/t/__init__.py b/t/__init__.py deleted file mode 100644 index cb95e53..0000000 --- a/t/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -import sys -sys.path[:0] = ['lib'] -- 2.39.5