review/tests/test_comment.py @ 467dacbab7d6

Move the review output into messages, and add a no-comments test.
author Steve Losh <steve@stevelosh.com>
date Sun, 04 Oct 2009 19:41:58 -0400
parents 35fbbd1bbd26
children adce24d24176
from nose import *
from util import *

import os
from .. import messages
from mercurial import util as hgutil


@with_setup(setup_reviewed_sandbox, teardown_sandbox)
def test_blank_comment():
    sandbox = get_sandbox_repo()
    
    try:
        review(comment=True)
    except hgutil.Abort, e:
        error = str(e)
        assert messages.COMMENT_REQUIRES_MESSAGE in error
    else:
        assert False, 'The correct error message was not printed.'


@with_setup(setup_reviewed_sandbox, teardown_sandbox)
def test_no_comments():
    sandbox = get_sandbox_repo()
    
    gather_output()
    review()
    output = grab_output()
    
    assert messages.REVIEW_LOG_COMMENTS % (0, 0) in output