Add more structure to the tests.
author |
Steve Losh <steve@stevelosh.com> |
date |
Sun, 04 Oct 2009 15:32:39 -0400 |
parents |
6b629b714299
|
children |
3e7777d0654e
|
branches/tags |
(none) |
files |
review/tests/test_init.py |
Changes
--- 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