# HG changeset patch # User Steve Losh # Date 1254684759 14400 # Node ID 896d4023c274f97194b7b11f0122ee31960ee770 # Parent 6b629b71429913ceda5eb06574ac1582d46012af Add more structure to the tests. diff -r 6b629b714299 -r 896d4023c274 review/tests/test_init.py --- a/review/tests/test_init.py Sun Oct 04 15:26:27 2009 -0400 +++ b/review/tests/test_init.py Sun Oct 04 15:32:39 2009 -0400 @@ -1,6 +1,6 @@ from nose import * -from mercurial import commands, ui -import os +from mercurial import commands, hg, ui +import os, shutil sandbox_path = os.path.join(os.path.realpath('.'), 'hgreview_test') @@ -10,12 +10,15 @@ os.chdir(sandbox_path) commands.init(ui.ui()) - + def teardown_sandbox(): os.chdir(os.path.realpath(os.path.join(sandbox_path, os.pardir))) - os.rmdir(sandbox_path) - + shutil.rmtree(sandbox_path) + +def get_sandbox_repo(): + return hg.repository(ui.ui(), '.') + @with_setup(setup_sandbox, teardown_sandbox) def test_default_init(): - pass \ No newline at end of file + sandbox = get_sandbox_repo() \ No newline at end of file