view tests/test_util.py @ 21:8626f3d2e50b

Add a small stack of tests that exercise some of the interesting special cases.
author Augie Fackler <durin42@gmail.com>
date Wed, 08 Oct 2008 18:17:29 -0500
parents 48a44546c12f
children 95d0109e495e
line wrap: on
line source

import os
import popen2

FIXTURES = os.path.join(os.path.abspath(os.path.dirname(__file__)),
                        'fixtures')

def load_svndump_fixture(path, fixture_name):
    '''Loads an svnadmin dump into a fresh repo at path, which should not
    already exist.
    '''
    os.spawnvp(os.P_WAIT, 'svnadmin', ['svnadmin', 'create', path,])
    proc = popen2.Popen4(['svnadmin', 'load', path,])
    inp = open(os.path.join(FIXTURES, fixture_name))
    proc.tochild.write(inp.read())
    proc.tochild.close()
    proc.wait()