review/tests/test_init.py @ 896d4023c274

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
from nose import *
from mercurial import commands, hg, ui
import os, shutil


sandbox_path = os.path.join(os.path.realpath('.'), 'hgreview_test')

def setup_sandbox():
    os.mkdir(sandbox_path)
    os.chdir(sandbox_path)
    
    commands.init(ui.ui())

def teardown_sandbox():
    os.chdir(os.path.realpath(os.path.join(sandbox_path, os.pardir)))
    shutil.rmtree(sandbox_path)

def get_sandbox_repo():
    return hg.repository(ui.ui(), '.')


@with_setup(setup_sandbox, teardown_sandbox)
def test_default_init():
    sandbox = get_sandbox_repo()