diff --git a/rhodecode/tests/functional/test_compare.py b/rhodecode/tests/functional/test_compare.py --- a/rhodecode/tests/functional/test_compare.py +++ b/rhodecode/tests/functional/test_compare.py @@ -1,7 +1,52 @@ from rhodecode.tests import * + class TestCompareController(TestController): - def test_index(self): - response = self.app.get(url(controller='compare', action='index')) - # Test response... + def test_index_tag(self): + self.log_user() + tag1='0.1.3' + tag2='0.1.2' + response = self.app.get(url(controller='compare', action='index', + repo_name=HG_REPO, + org_ref_type="tag", + org_ref=tag1, + other_ref_type="tag", + other_ref=tag2, + )) + response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, tag1, HG_REPO, tag2)) + ## outgoing changesets between tags + response.mustcontain('''r120:17544fbfcd33''' % HG_REPO) + response.mustcontain('''r119:36e0fc9d2808''' % HG_REPO) + response.mustcontain('''r118:bb1a3ab98cc4''' % HG_REPO) + response.mustcontain('''r117:41fda979f02f''' % HG_REPO) + response.mustcontain('''r116:9749bfbfc0d2''' % HG_REPO) + response.mustcontain('''r115:70d4cef8a376''' % HG_REPO) + response.mustcontain('''r112:c5ddebc06eaa''' % HG_REPO) + + ## files diff + response.mustcontain('''
docs/api/utils/index.rst
''' % (HG_REPO, tag1, tag2)) + response.mustcontain('''
test_and_report.sh
''' % (HG_REPO, tag1, tag2)) + response.mustcontain('''
.hgignore
''' % (HG_REPO, tag1, tag2)) + response.mustcontain('''
.hgtags
''' % (HG_REPO, tag1, tag2)) + response.mustcontain('''
docs/api/index.rst
''' % (HG_REPO, tag1, tag2)) + response.mustcontain('''
vcs/__init__.py
''' % (HG_REPO, tag1, tag2)) + response.mustcontain('''
vcs/backends/hg.py
''' % (HG_REPO, tag1, tag2)) + response.mustcontain('''
vcs/utils/__init__.py
''' % (HG_REPO, tag1, tag2)) + response.mustcontain('''
vcs/utils/annotate.py
''' % (HG_REPO, tag1, tag2)) + response.mustcontain('''
vcs/utils/diffs.py
''' % (HG_REPO, tag1, tag2)) + response.mustcontain('''
vcs/utils/lazy.py
''' % (HG_REPO, tag1, tag2)) + + def test_index_branch(self): + self.log_user() + response = self.app.get(url(controller='compare', action='index', + repo_name=HG_REPO, + org_ref_type="branch", + org_ref='default', + other_ref_type="branch", + other_ref='default', + )) + + response.mustcontain('%s@default -> %s@default' % (HG_REPO, HG_REPO)) + # branch are equal + response.mustcontain('No changesets')