94b4bdc4a60c
Test double inits.
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Sun, 04 Oct 2009 19:19:01 -0400 |
parents | e72a3408cc68 |
children | 35fbbd1bbd26 |
branches/tags | (none) |
files | review/tests/test_init.py |
Changes
--- a/review/tests/test_init.py Sun Oct 04 19:09:55 2009 -0400 +++ b/review/tests/test_init.py Sun Oct 04 19:19:01 2009 -0400 @@ -3,6 +3,7 @@ import os from .. import messages +from mercurial import util as hgutil @with_setup(setup_sandbox, teardown_sandbox) @@ -88,3 +89,17 @@ assert 'local = codereview' in hgr assert 'remote = ../code-review' in hgr + +@with_setup(setup_sandbox, teardown_sandbox) +def test_init_twice(): + sandbox = get_sandbox_repo() + + try: + review(init=True) + review(init=True) + except hgutil.Abort, e: + error = str(e) + assert messages.INIT_EXISTS_UNCOMMITTED in error + else: + assert False, 'The correct error message was not printed.' +