diff --git a/kallithea/tests/__init__.py b/kallithea/tests/__init__.py --- a/kallithea/tests/__init__.py +++ b/kallithea/tests/__init__.py @@ -61,7 +61,7 @@ skipif = pytest.mark.skipif parametrize = pytest.mark.parametrize __all__ = [ - 'skipif', 'parametrize', 'environ', 'url', 'TestControllerPytest', + 'skipif', 'parametrize', 'environ', 'url', 'TestController', 'ldap_lib_installed', 'pam_lib_installed', 'TESTS_TMP_PATH', 'HG_REPO', 'GIT_REPO', 'NEW_HG_REPO', 'NEW_GIT_REPO', 'HG_FORK', 'GIT_FORK', 'TEST_USER_ADMIN_LOGIN', 'TEST_USER_ADMIN_PASS', @@ -148,7 +148,7 @@ class NullHandler(logging.Handler): def emit(self, record): pass -class TestControllerPytest(object): +class TestController(object): """Pytest-style test controller""" # Note: pytest base classes cannot have an __init__ method diff --git a/kallithea/tests/api/test_api_git.py b/kallithea/tests/api/test_api_git.py --- a/kallithea/tests/api/test_api_git.py +++ b/kallithea/tests/api/test_api_git.py @@ -12,10 +12,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from kallithea.tests import TestControllerPytest, GIT_REPO +from kallithea.tests import TestController, GIT_REPO from kallithea.tests.api.api_base import _BaseTestApi -class TestGitApi(_BaseTestApi, TestControllerPytest): +class TestGitApi(_BaseTestApi, TestController): REPO = GIT_REPO REPO_TYPE = 'git' diff --git a/kallithea/tests/api/test_api_hg.py b/kallithea/tests/api/test_api_hg.py --- a/kallithea/tests/api/test_api_hg.py +++ b/kallithea/tests/api/test_api_hg.py @@ -12,10 +12,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from kallithea.tests import TestControllerPytest, HG_REPO +from kallithea.tests import TestController, HG_REPO from kallithea.tests.api.api_base import _BaseTestApi -class TestHgApi(_BaseTestApi, TestControllerPytest): +class TestHgApi(_BaseTestApi, TestController): REPO = HG_REPO REPO_TYPE = 'hg' diff --git a/kallithea/tests/functional/test_admin.py b/kallithea/tests/functional/test_admin.py --- a/kallithea/tests/functional/test_admin.py +++ b/kallithea/tests/functional/test_admin.py @@ -10,7 +10,7 @@ dn = os.path.dirname FIXTURES = os.path.join(dn(dn(os.path.abspath(__file__))), 'fixtures') -class TestAdminController(TestControllerPytest): +class TestAdminController(TestController): @classmethod def setup_class(cls): diff --git a/kallithea/tests/functional/test_admin_auth_settings.py b/kallithea/tests/functional/test_admin_auth_settings.py --- a/kallithea/tests/functional/test_admin_auth_settings.py +++ b/kallithea/tests/functional/test_admin_auth_settings.py @@ -2,7 +2,7 @@ from kallithea.tests import * from kallithea.model.db import Setting -class TestAuthSettingsController(TestControllerPytest): +class TestAuthSettingsController(TestController): def _enable_plugins(self, plugins_list): test_url = url(controller='admin/auth_settings', action='auth_settings') diff --git a/kallithea/tests/functional/test_admin_defaults.py b/kallithea/tests/functional/test_admin_defaults.py --- a/kallithea/tests/functional/test_admin_defaults.py +++ b/kallithea/tests/functional/test_admin_defaults.py @@ -2,7 +2,7 @@ from kallithea.tests import * from kallithea.model.db import Setting -class TestDefaultsController(TestControllerPytest): +class TestDefaultsController(TestController): def test_index(self): self.log_user() diff --git a/kallithea/tests/functional/test_admin_gists.py b/kallithea/tests/functional/test_admin_gists.py --- a/kallithea/tests/functional/test_admin_gists.py +++ b/kallithea/tests/functional/test_admin_gists.py @@ -18,7 +18,7 @@ def _create_gist(f_name, content='some g return gist -class TestGistsController(TestControllerPytest): +class TestGistsController(TestController): def teardown_method(self, method): for g in Gist.get_all(): diff --git a/kallithea/tests/functional/test_admin_notifications.py b/kallithea/tests/functional/test_admin_notifications.py --- a/kallithea/tests/functional/test_admin_notifications.py +++ b/kallithea/tests/functional/test_admin_notifications.py @@ -7,7 +7,7 @@ from kallithea.model.meta import Session from kallithea.lib import helpers as h -class TestNotificationsController(TestControllerPytest): +class TestNotificationsController(TestController): def setup_method(self, method): self.remove_all_notifications() diff --git a/kallithea/tests/functional/test_admin_permissions.py b/kallithea/tests/functional/test_admin_permissions.py --- a/kallithea/tests/functional/test_admin_permissions.py +++ b/kallithea/tests/functional/test_admin_permissions.py @@ -3,7 +3,7 @@ import time from kallithea.model.db import User, UserIpMap from kallithea.tests import * -class TestAdminPermissionsController(TestControllerPytest): +class TestAdminPermissionsController(TestController): def test_index(self): self.log_user() diff --git a/kallithea/tests/functional/test_admin_repo_groups.py b/kallithea/tests/functional/test_admin_repo_groups.py --- a/kallithea/tests/functional/test_admin_repo_groups.py +++ b/kallithea/tests/functional/test_admin_repo_groups.py @@ -1,4 +1,4 @@ from kallithea.tests import * -class TestRepoGroupsController(TestControllerPytest): +class TestRepoGroupsController(TestController): pass diff --git a/kallithea/tests/functional/test_admin_repos.py b/kallithea/tests/functional/test_admin_repos.py --- a/kallithea/tests/functional/test_admin_repos.py +++ b/kallithea/tests/functional/test_admin_repos.py @@ -27,7 +27,7 @@ def _get_permission_for_user(user, repo) return perm -class _BaseTestCase(TestControllerPytest): +class _BaseTestCase(TestController): """ Write all tests here """ diff --git a/kallithea/tests/functional/test_admin_settings.py b/kallithea/tests/functional/test_admin_settings.py --- a/kallithea/tests/functional/test_admin_settings.py +++ b/kallithea/tests/functional/test_admin_settings.py @@ -9,7 +9,7 @@ from kallithea.tests.fixture import Fixt fixture = Fixture() -class TestAdminSettingsController(TestControllerPytest): +class TestAdminSettingsController(TestController): def test_index_main(self): self.log_user() diff --git a/kallithea/tests/functional/test_admin_user_groups.py b/kallithea/tests/functional/test_admin_user_groups.py --- a/kallithea/tests/functional/test_admin_user_groups.py +++ b/kallithea/tests/functional/test_admin_user_groups.py @@ -6,7 +6,7 @@ from kallithea.model.meta import Session TEST_USER_GROUP = u'admins_test' -class TestAdminUsersGroupsController(TestControllerPytest): +class TestAdminUsersGroupsController(TestController): def test_index(self): self.log_user() diff --git a/kallithea/tests/functional/test_admin_users.py b/kallithea/tests/functional/test_admin_users.py --- a/kallithea/tests/functional/test_admin_users.py +++ b/kallithea/tests/functional/test_admin_users.py @@ -29,7 +29,7 @@ from webob.exc import HTTPNotFound fixture = Fixture() -class TestAdminUsersController(TestControllerPytest): +class TestAdminUsersController(TestController): test_user_1 = 'testme' @classmethod @@ -530,7 +530,7 @@ class TestAdminUsersController_unittest( u._get_user_or_raise_if_default(User.get_default_user().user_id) -class TestAdminUsersControllerForDefaultUser(TestControllerPytest): +class TestAdminUsersControllerForDefaultUser(TestController): """ Edit actions on the default user are not allowed. Validate that they throw a 404 exception. diff --git a/kallithea/tests/functional/test_branches.py b/kallithea/tests/functional/test_branches.py --- a/kallithea/tests/functional/test_branches.py +++ b/kallithea/tests/functional/test_branches.py @@ -1,7 +1,7 @@ from kallithea.tests import * -class TestBranchesController(TestControllerPytest): +class TestBranchesController(TestController): def test_index_hg(self): self.log_user() diff --git a/kallithea/tests/functional/test_changelog.py b/kallithea/tests/functional/test_changelog.py --- a/kallithea/tests/functional/test_changelog.py +++ b/kallithea/tests/functional/test_changelog.py @@ -1,7 +1,7 @@ from kallithea.tests import * -class TestChangelogController(TestControllerPytest): +class TestChangelogController(TestController): def test_index_hg(self): self.log_user() diff --git a/kallithea/tests/functional/test_changeset.py b/kallithea/tests/functional/test_changeset.py --- a/kallithea/tests/functional/test_changeset.py +++ b/kallithea/tests/functional/test_changeset.py @@ -1,6 +1,6 @@ from kallithea.tests import * -class TestChangesetController(TestControllerPytest): +class TestChangesetController(TestController): def test_index(self): response = self.app.get(url(controller='changeset', action='index', diff --git a/kallithea/tests/functional/test_changeset_comments.py b/kallithea/tests/functional/test_changeset_comments.py --- a/kallithea/tests/functional/test_changeset_comments.py +++ b/kallithea/tests/functional/test_changeset_comments.py @@ -4,7 +4,7 @@ from kallithea.model.db import Changeset from kallithea.model.meta import Session -class TestChangeSetCommentsController(TestControllerPytest): +class TestChangeSetCommentsController(TestController): def setup_method(self, method): for x in ChangesetComment.query().all(): diff --git a/kallithea/tests/functional/test_compare.py b/kallithea/tests/functional/test_compare.py --- a/kallithea/tests/functional/test_compare.py +++ b/kallithea/tests/functional/test_compare.py @@ -10,7 +10,7 @@ def _commit_div(sha, msg): return """
%s
""" % (sha, msg) -class TestCompareController(TestControllerPytest): +class TestCompareController(TestController): def setup_method(self, method): self.r1_id = None diff --git a/kallithea/tests/functional/test_compare_local.py b/kallithea/tests/functional/test_compare_local.py --- a/kallithea/tests/functional/test_compare_local.py +++ b/kallithea/tests/functional/test_compare_local.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from kallithea.tests import * -class TestCompareController(TestControllerPytest): +class TestCompareController(TestController): def test_compare_tag_hg(self): self.log_user() diff --git a/kallithea/tests/functional/test_feed.py b/kallithea/tests/functional/test_feed.py --- a/kallithea/tests/functional/test_feed.py +++ b/kallithea/tests/functional/test_feed.py @@ -1,6 +1,6 @@ from kallithea.tests import * -class TestFeedController(TestControllerPytest): +class TestFeedController(TestController): def test_rss(self): self.log_user() diff --git a/kallithea/tests/functional/test_files.py b/kallithea/tests/functional/test_files.py --- a/kallithea/tests/functional/test_files.py +++ b/kallithea/tests/functional/test_files.py @@ -26,7 +26,7 @@ def _set_downloads(repo_name, set_to): Session().commit() -class TestFilesController(TestControllerPytest): +class TestFilesController(TestController): def test_index(self): self.log_user() diff --git a/kallithea/tests/functional/test_followers.py b/kallithea/tests/functional/test_followers.py --- a/kallithea/tests/functional/test_followers.py +++ b/kallithea/tests/functional/test_followers.py @@ -1,7 +1,7 @@ from kallithea.tests import * -class TestFollowersController(TestControllerPytest): +class TestFollowersController(TestController): def test_index_hg(self): self.log_user() diff --git a/kallithea/tests/functional/test_forks.py b/kallithea/tests/functional/test_forks.py --- a/kallithea/tests/functional/test_forks.py +++ b/kallithea/tests/functional/test_forks.py @@ -12,7 +12,7 @@ from kallithea.model.meta import Session fixture = Fixture() -class _BaseTestCase(TestControllerPytest): +class _BaseTestCase(TestController): """ Write all tests here """ diff --git a/kallithea/tests/functional/test_home.py b/kallithea/tests/functional/test_home.py --- a/kallithea/tests/functional/test_home.py +++ b/kallithea/tests/functional/test_home.py @@ -9,7 +9,7 @@ from kallithea.model.repo_group import R fixture = Fixture() -class TestHomeController(TestControllerPytest): +class TestHomeController(TestController): def test_index(self): self.log_user() diff --git a/kallithea/tests/functional/test_journal.py b/kallithea/tests/functional/test_journal.py --- a/kallithea/tests/functional/test_journal.py +++ b/kallithea/tests/functional/test_journal.py @@ -2,7 +2,7 @@ from kallithea.tests import * import datetime -class TestJournalController(TestControllerPytest): +class TestJournalController(TestController): def test_index(self): self.log_user() diff --git a/kallithea/tests/functional/test_login.py b/kallithea/tests/functional/test_login.py --- a/kallithea/tests/functional/test_login.py +++ b/kallithea/tests/functional/test_login.py @@ -19,7 +19,7 @@ from kallithea.model.user import UserMod fixture = Fixture() -class TestLoginController(TestControllerPytest): +class TestLoginController(TestController): def setup_method(self, method): self.remove_all_notifications() assert Notification.query().all() == [] diff --git a/kallithea/tests/functional/test_my_account.py b/kallithea/tests/functional/test_my_account.py --- a/kallithea/tests/functional/test_my_account.py +++ b/kallithea/tests/functional/test_my_account.py @@ -10,7 +10,7 @@ from kallithea.model.meta import Session fixture = Fixture() -class TestMyAccountController(TestControllerPytest): +class TestMyAccountController(TestController): test_user_1 = 'testme' @classmethod diff --git a/kallithea/tests/functional/test_pullrequests.py b/kallithea/tests/functional/test_pullrequests.py --- a/kallithea/tests/functional/test_pullrequests.py +++ b/kallithea/tests/functional/test_pullrequests.py @@ -8,7 +8,7 @@ from kallithea.controllers.pullrequests fixture = Fixture() -class TestPullrequestsController(TestControllerPytest): +class TestPullrequestsController(TestController): def test_index(self): self.log_user() @@ -143,7 +143,7 @@ class TestPullrequestsController(TestCon status=400) response.mustcontain('Invalid reviewer "%s" specified' % invalid_user_id) -class TestPullrequestsGetRepoRefs(TestControllerPytest): +class TestPullrequestsGetRepoRefs(TestController): def setup_method(self, method): self.main = fixture.create_repo(u'main', repo_type='hg') diff --git a/kallithea/tests/functional/test_repo_groups.py b/kallithea/tests/functional/test_repo_groups.py --- a/kallithea/tests/functional/test_repo_groups.py +++ b/kallithea/tests/functional/test_repo_groups.py @@ -1,7 +1,7 @@ from kallithea.tests import * -class TestRepoGroupsController(TestControllerPytest): +class TestRepoGroupsController(TestController): def test_index(self): self.log_user() diff --git a/kallithea/tests/functional/test_search.py b/kallithea/tests/functional/test_search.py --- a/kallithea/tests/functional/test_search.py +++ b/kallithea/tests/functional/test_search.py @@ -3,7 +3,7 @@ import os from kallithea.tests import * -class TestSearchController(TestControllerPytest): +class TestSearchController(TestController): def test_index(self): self.log_user() diff --git a/kallithea/tests/functional/test_summary.py b/kallithea/tests/functional/test_summary.py --- a/kallithea/tests/functional/test_summary.py +++ b/kallithea/tests/functional/test_summary.py @@ -22,7 +22,7 @@ from kallithea.model.scm import ScmModel fixture = Fixture() -class TestSummaryController(TestControllerPytest): +class TestSummaryController(TestController): def test_index(self): self.log_user() diff --git a/kallithea/tests/functional/test_tags.py b/kallithea/tests/functional/test_tags.py --- a/kallithea/tests/functional/test_tags.py +++ b/kallithea/tests/functional/test_tags.py @@ -1,7 +1,7 @@ from kallithea.tests import * -class TestTagsController(TestControllerPytest): +class TestTagsController(TestController): def test_index_hg(self): self.log_user() diff --git a/kallithea/tests/models/test_changeset_status.py b/kallithea/tests/models/test_changeset_status.py --- a/kallithea/tests/models/test_changeset_status.py +++ b/kallithea/tests/models/test_changeset_status.py @@ -7,7 +7,7 @@ class CSM(object): # ChangesetStatusMock def __init__(self, status): self.status = status -class TestChangesetStatusCalculation(TestControllerPytest): +class TestChangesetStatusCalculation(TestController): def setup_method(self, method): self.m = ChangesetStatusModel() diff --git a/kallithea/tests/models/test_diff_parsers.py b/kallithea/tests/models/test_diff_parsers.py --- a/kallithea/tests/models/test_diff_parsers.py +++ b/kallithea/tests/models/test_diff_parsers.py @@ -271,7 +271,7 @@ DIFF_FIXTURES = { } -class TestDiffLib(TestControllerPytest): +class TestDiffLib(TestController): @parametrize('diff_fixture', DIFF_FIXTURES) def test_diff(self, diff_fixture): diff --git a/kallithea/tests/models/test_notifications.py b/kallithea/tests/models/test_notifications.py --- a/kallithea/tests/models/test_notifications.py +++ b/kallithea/tests/models/test_notifications.py @@ -7,7 +7,7 @@ from kallithea.model.meta import Session from kallithea.model.notification import NotificationModel -class TestNotifications(TestControllerPytest): +class TestNotifications(TestController): def setup_method(self, method): Session.remove() diff --git a/kallithea/tests/models/test_permissions.py b/kallithea/tests/models/test_permissions.py --- a/kallithea/tests/models/test_permissions.py +++ b/kallithea/tests/models/test_permissions.py @@ -15,7 +15,7 @@ from kallithea.model.permission import P fixture = Fixture() -class TestPermissions(TestControllerPytest): +class TestPermissions(TestController): @classmethod def setup_class(cls): diff --git a/kallithea/tests/models/test_repo_groups.py b/kallithea/tests/models/test_repo_groups.py --- a/kallithea/tests/models/test_repo_groups.py +++ b/kallithea/tests/models/test_repo_groups.py @@ -34,7 +34,7 @@ def _update_repo(name, **kwargs): return r -class TestRepoGroups(TestControllerPytest): +class TestRepoGroups(TestController): def setup_method(self, method): self.g1 = fixture.create_repo_group(u'test1', skip_if_exists=True) diff --git a/kallithea/tests/models/test_repos.py b/kallithea/tests/models/test_repos.py --- a/kallithea/tests/models/test_repos.py +++ b/kallithea/tests/models/test_repos.py @@ -10,7 +10,7 @@ from kallithea.lib.exceptions import Att fixture = Fixture() -class TestRepos(TestControllerPytest): +class TestRepos(TestController): def teardown_method(self, method): Session.remove() diff --git a/kallithea/tests/models/test_user_groups.py b/kallithea/tests/models/test_user_groups.py --- a/kallithea/tests/models/test_user_groups.py +++ b/kallithea/tests/models/test_user_groups.py @@ -10,7 +10,7 @@ from kallithea.model.meta import Session fixture = Fixture() -class TestUserGroups(TestControllerPytest): +class TestUserGroups(TestController): def teardown_method(self, method): # delete all groups diff --git a/kallithea/tests/models/test_users.py b/kallithea/tests/models/test_users.py --- a/kallithea/tests/models/test_users.py +++ b/kallithea/tests/models/test_users.py @@ -12,7 +12,7 @@ from kallithea.tests.fixture import Fixt fixture = Fixture() -class TestUser(TestControllerPytest): +class TestUser(TestController): @classmethod def setup_class(cls): @@ -99,7 +99,7 @@ class TestUser(TestControllerPytest): Session().commit() -class TestUsers(TestControllerPytest): +class TestUsers(TestController): def setup_method(self, method): self.u1 = UserModel().create_or_update(username=u'u1', diff --git a/kallithea/tests/other/manual_test_vcs_operations.py b/kallithea/tests/other/manual_test_vcs_operations.py --- a/kallithea/tests/other/manual_test_vcs_operations.py +++ b/kallithea/tests/other/manual_test_vcs_operations.py @@ -166,7 +166,7 @@ def _check_proper_git_push(stdout, stder assert 'master -> master' in stderr -class TestVCSOperations(TestControllerPytest): +class TestVCSOperations(TestController): @classmethod def setup_class(cls): diff --git a/kallithea/tests/other/test_libs.py b/kallithea/tests/other/test_libs.py --- a/kallithea/tests/other/test_libs.py +++ b/kallithea/tests/other/test_libs.py @@ -67,7 +67,7 @@ TEST_URLS += [ ] -class TestLibs(TestControllerPytest): +class TestLibs(TestController): @parametrize('test_url,expected,expected_creds', TEST_URLS) def test_uri_filter(self, test_url, expected, expected_creds): diff --git a/kallithea/tests/other/test_mail.py b/kallithea/tests/other/test_mail.py --- a/kallithea/tests/other/test_mail.py +++ b/kallithea/tests/other/test_mail.py @@ -21,7 +21,7 @@ class smtplib_mock(object): pass @mock.patch('kallithea.lib.rcmail.smtp_mailer.smtplib', smtplib_mock) -class TestMail(TestControllerPytest): +class TestMail(TestController): def test_send_mail_trivial(self): mailserver = 'smtp.mailserver.org' diff --git a/kallithea/tests/other/test_validators.py b/kallithea/tests/other/test_validators.py --- a/kallithea/tests/other/test_validators.py +++ b/kallithea/tests/other/test_validators.py @@ -15,7 +15,7 @@ from kallithea.tests.fixture import Fixt fixture = Fixture() -class TestRepoGroups(TestControllerPytest): +class TestRepoGroups(TestController): def teardown_method(self, method): Session.remove()