5 from os
.path
import join
6 from os
.path
import dirname
7 from os
.path
import basename
12 DEBUG_MODE
= os
.getenv('COLA_TEST_DEBUG','')
14 TEST_SCRIPT_DIR
= dirname(__file__
)
15 ROOT_TMP_DIR
= join(TEST_SCRIPT_DIR
, 'tmp')
16 TEST_TMP_DIR
= join(ROOT_TMP_DIR
, basename(sys
.argv
[0]))
22 """Returns a path relative to the test/tmp directory"""
23 return join(TEST_SCRIPT_DIR
, 'tmp', *paths
)
26 return join(TEST_SCRIPT_DIR
, 'fixtures', *paths
)
30 parentdir
= dirname(newdir
)
31 if not os
.path
.isdir(parentdir
):
33 if not os
.path
.isdir(newdir
):
38 return '%s-%d.%04d' % (TEST_TMP_DIR
, os
.getpid(), LAST_IDX
)
50 os
.chdir(ROOT_TMP_DIR
)
64 out
= core
.read_nointr(p
).strip()
69 class TestCase(unittest
.TestCase
):
70 """Tests that operate on temporary git repositories."""
79 self
.failIf(result
!= 0)