annotate tests/test_util.py @ 20:2953c867ca99

Minor fixes to the push command to make it more robust.
author Augie Fackler <durin42@gmail.com>
date Wed, 08 Oct 2008 16:44:40 -0500
parents 48a44546c12f
children 95d0109e495e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
1 import os
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
2 import popen2
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
3
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
4 FIXTURES = os.path.join(os.path.abspath(os.path.dirname(__file__)),
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
5 'fixtures')
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
6
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
7 def load_svndump_fixture(path, fixture_name):
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
8 '''Loads an svnadmin dump into a fresh repo at path, which should not
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
9 already exist.
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
10 '''
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
11 os.spawnvp(os.P_WAIT, 'svnadmin', ['svnadmin', 'create', path,])
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
12 proc = popen2.Popen4(['svnadmin', 'load', path,])
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
13 inp = open(os.path.join(FIXTURES, fixture_name))
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
14 proc.tochild.write(inp.read())
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
15 proc.tochild.close()
d78dbf88c13d Started a meaningful test suite.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
16 proc.wait()