changeset 5922:7f2aa3ec2931

pytest migration: rename TestControllerPytest back to TestController The name TestControllerPytest was introduced to allow a temporary situation where nose/unittest and pytest-based tests could coexist. This situation is now over, so the base test class can be renamed again.
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Sun, 15 May 2016 22:37:37 +0200
parents cbeed250b599
children 96779dba8b01
files kallithea/tests/__init__.py kallithea/tests/api/test_api_git.py kallithea/tests/api/test_api_hg.py kallithea/tests/functional/test_admin.py kallithea/tests/functional/test_admin_auth_settings.py kallithea/tests/functional/test_admin_defaults.py kallithea/tests/functional/test_admin_gists.py kallithea/tests/functional/test_admin_notifications.py kallithea/tests/functional/test_admin_permissions.py kallithea/tests/functional/test_admin_repo_groups.py kallithea/tests/functional/test_admin_repos.py kallithea/tests/functional/test_admin_settings.py kallithea/tests/functional/test_admin_user_groups.py kallithea/tests/functional/test_admin_users.py kallithea/tests/functional/test_branches.py kallithea/tests/functional/test_changelog.py kallithea/tests/functional/test_changeset.py kallithea/tests/functional/test_changeset_comments.py kallithea/tests/functional/test_compare.py kallithea/tests/functional/test_compare_local.py kallithea/tests/functional/test_feed.py kallithea/tests/functional/test_files.py kallithea/tests/functional/test_followers.py kallithea/tests/functional/test_forks.py kallithea/tests/functional/test_home.py kallithea/tests/functional/test_journal.py kallithea/tests/functional/test_login.py kallithea/tests/functional/test_my_account.py kallithea/tests/functional/test_pullrequests.py kallithea/tests/functional/test_repo_groups.py kallithea/tests/functional/test_search.py kallithea/tests/functional/test_summary.py kallithea/tests/functional/test_tags.py kallithea/tests/models/test_changeset_status.py kallithea/tests/models/test_diff_parsers.py kallithea/tests/models/test_notifications.py kallithea/tests/models/test_permissions.py kallithea/tests/models/test_repo_groups.py kallithea/tests/models/test_repos.py kallithea/tests/models/test_user_groups.py kallithea/tests/models/test_users.py kallithea/tests/other/manual_test_vcs_operations.py kallithea/tests/other/test_libs.py kallithea/tests/other/test_mail.py kallithea/tests/other/test_validators.py
diffstat 45 files changed, 51 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/tests/__init__.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/__init__.py	Sun May 15 22:37:37 2016 +0200
@@ -61,7 +61,7 @@
 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 @@
     def emit(self, record):
         pass
 
-class TestControllerPytest(object):
+class TestController(object):
     """Pytest-style test controller"""
 
     # Note: pytest base classes cannot have an __init__ method
--- a/kallithea/tests/api/test_api_git.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/api/test_api_git.py	Sun May 15 22:37:37 2016 +0200
@@ -12,10 +12,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-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'
--- a/kallithea/tests/api/test_api_hg.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/api/test_api_hg.py	Sun May 15 22:37:37 2016 +0200
@@ -12,10 +12,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-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'
--- a/kallithea/tests/functional/test_admin.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_admin.py	Sun May 15 22:37:37 2016 +0200
@@ -10,7 +10,7 @@
 FIXTURES = os.path.join(dn(dn(os.path.abspath(__file__))), 'fixtures')
 
 
-class TestAdminController(TestControllerPytest):
+class TestAdminController(TestController):
 
     @classmethod
     def setup_class(cls):
--- a/kallithea/tests/functional/test_admin_auth_settings.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_admin_auth_settings.py	Sun May 15 22:37:37 2016 +0200
@@ -2,7 +2,7 @@
 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')
--- a/kallithea/tests/functional/test_admin_defaults.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_admin_defaults.py	Sun May 15 22:37:37 2016 +0200
@@ -2,7 +2,7 @@
 from kallithea.model.db import Setting
 
 
-class TestDefaultsController(TestControllerPytest):
+class TestDefaultsController(TestController):
 
     def test_index(self):
         self.log_user()
--- a/kallithea/tests/functional/test_admin_gists.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_admin_gists.py	Sun May 15 22:37:37 2016 +0200
@@ -18,7 +18,7 @@
     return gist
 
 
-class TestGistsController(TestControllerPytest):
+class TestGistsController(TestController):
 
     def teardown_method(self, method):
         for g in Gist.get_all():
--- a/kallithea/tests/functional/test_admin_notifications.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_admin_notifications.py	Sun May 15 22:37:37 2016 +0200
@@ -7,7 +7,7 @@
 from kallithea.lib import helpers as h
 
 
-class TestNotificationsController(TestControllerPytest):
+class TestNotificationsController(TestController):
     def setup_method(self, method):
         self.remove_all_notifications()
 
--- a/kallithea/tests/functional/test_admin_permissions.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_admin_permissions.py	Sun May 15 22:37:37 2016 +0200
@@ -3,7 +3,7 @@
 from kallithea.model.db import User, UserIpMap
 from kallithea.tests import *
 
-class TestAdminPermissionsController(TestControllerPytest):
+class TestAdminPermissionsController(TestController):
 
     def test_index(self):
         self.log_user()
--- a/kallithea/tests/functional/test_admin_repo_groups.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_admin_repo_groups.py	Sun May 15 22:37:37 2016 +0200
@@ -1,4 +1,4 @@
 from kallithea.tests import *
 
-class TestRepoGroupsController(TestControllerPytest):
+class TestRepoGroupsController(TestController):
     pass
--- a/kallithea/tests/functional/test_admin_repos.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_admin_repos.py	Sun May 15 22:37:37 2016 +0200
@@ -27,7 +27,7 @@
     return perm
 
 
-class _BaseTestCase(TestControllerPytest):
+class _BaseTestCase(TestController):
     """
     Write all tests here
     """
--- a/kallithea/tests/functional/test_admin_settings.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_admin_settings.py	Sun May 15 22:37:37 2016 +0200
@@ -9,7 +9,7 @@
 fixture = Fixture()
 
 
-class TestAdminSettingsController(TestControllerPytest):
+class TestAdminSettingsController(TestController):
 
     def test_index_main(self):
         self.log_user()
--- a/kallithea/tests/functional/test_admin_user_groups.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_admin_user_groups.py	Sun May 15 22:37:37 2016 +0200
@@ -6,7 +6,7 @@
 TEST_USER_GROUP = u'admins_test'
 
 
-class TestAdminUsersGroupsController(TestControllerPytest):
+class TestAdminUsersGroupsController(TestController):
 
     def test_index(self):
         self.log_user()
--- a/kallithea/tests/functional/test_admin_users.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_admin_users.py	Sun May 15 22:37:37 2016 +0200
@@ -29,7 +29,7 @@
 fixture = Fixture()
 
 
-class TestAdminUsersController(TestControllerPytest):
+class TestAdminUsersController(TestController):
     test_user_1 = 'testme'
 
     @classmethod
@@ -530,7 +530,7 @@
             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.
--- a/kallithea/tests/functional/test_branches.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_branches.py	Sun May 15 22:37:37 2016 +0200
@@ -1,7 +1,7 @@
 from kallithea.tests import *
 
 
-class TestBranchesController(TestControllerPytest):
+class TestBranchesController(TestController):
 
     def test_index_hg(self):
         self.log_user()
--- a/kallithea/tests/functional/test_changelog.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_changelog.py	Sun May 15 22:37:37 2016 +0200
@@ -1,7 +1,7 @@
 from kallithea.tests import *
 
 
-class TestChangelogController(TestControllerPytest):
+class TestChangelogController(TestController):
 
     def test_index_hg(self):
         self.log_user()
--- a/kallithea/tests/functional/test_changeset.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_changeset.py	Sun May 15 22:37:37 2016 +0200
@@ -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',
--- a/kallithea/tests/functional/test_changeset_comments.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_changeset_comments.py	Sun May 15 22:37:37 2016 +0200
@@ -4,7 +4,7 @@
 from kallithea.model.meta import Session
 
 
-class TestChangeSetCommentsController(TestControllerPytest):
+class TestChangeSetCommentsController(TestController):
 
     def setup_method(self, method):
         for x in ChangesetComment.query().all():
--- a/kallithea/tests/functional/test_compare.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_compare.py	Sun May 15 22:37:37 2016 +0200
@@ -10,7 +10,7 @@
     return """<div id="C-%s" class="message">%s</div>""" % (sha, msg)
 
 
-class TestCompareController(TestControllerPytest):
+class TestCompareController(TestController):
 
     def setup_method(self, method):
         self.r1_id = None
--- a/kallithea/tests/functional/test_compare_local.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_compare_local.py	Sun May 15 22:37:37 2016 +0200
@@ -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()
--- a/kallithea/tests/functional/test_feed.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_feed.py	Sun May 15 22:37:37 2016 +0200
@@ -1,6 +1,6 @@
 from kallithea.tests import *
 
-class TestFeedController(TestControllerPytest):
+class TestFeedController(TestController):
 
     def test_rss(self):
         self.log_user()
--- a/kallithea/tests/functional/test_files.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_files.py	Sun May 15 22:37:37 2016 +0200
@@ -26,7 +26,7 @@
     Session().commit()
 
 
-class TestFilesController(TestControllerPytest):
+class TestFilesController(TestController):
 
     def test_index(self):
         self.log_user()
--- a/kallithea/tests/functional/test_followers.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_followers.py	Sun May 15 22:37:37 2016 +0200
@@ -1,7 +1,7 @@
 from kallithea.tests import *
 
 
-class TestFollowersController(TestControllerPytest):
+class TestFollowersController(TestController):
 
     def test_index_hg(self):
         self.log_user()
--- a/kallithea/tests/functional/test_forks.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_forks.py	Sun May 15 22:37:37 2016 +0200
@@ -12,7 +12,7 @@
 
 fixture = Fixture()
 
-class _BaseTestCase(TestControllerPytest):
+class _BaseTestCase(TestController):
     """
     Write all tests here
     """
--- a/kallithea/tests/functional/test_home.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_home.py	Sun May 15 22:37:37 2016 +0200
@@ -9,7 +9,7 @@
 fixture = Fixture()
 
 
-class TestHomeController(TestControllerPytest):
+class TestHomeController(TestController):
 
     def test_index(self):
         self.log_user()
--- a/kallithea/tests/functional/test_journal.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_journal.py	Sun May 15 22:37:37 2016 +0200
@@ -2,7 +2,7 @@
 import datetime
 
 
-class TestJournalController(TestControllerPytest):
+class TestJournalController(TestController):
 
     def test_index(self):
         self.log_user()
--- a/kallithea/tests/functional/test_login.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_login.py	Sun May 15 22:37:37 2016 +0200
@@ -19,7 +19,7 @@
 fixture = Fixture()
 
 
-class TestLoginController(TestControllerPytest):
+class TestLoginController(TestController):
     def setup_method(self, method):
         self.remove_all_notifications()
         assert Notification.query().all() == []
--- a/kallithea/tests/functional/test_my_account.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_my_account.py	Sun May 15 22:37:37 2016 +0200
@@ -10,7 +10,7 @@
 fixture = Fixture()
 
 
-class TestMyAccountController(TestControllerPytest):
+class TestMyAccountController(TestController):
     test_user_1 = 'testme'
 
     @classmethod
--- a/kallithea/tests/functional/test_pullrequests.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_pullrequests.py	Sun May 15 22:37:37 2016 +0200
@@ -8,7 +8,7 @@
 
 fixture = Fixture()
 
-class TestPullrequestsController(TestControllerPytest):
+class TestPullrequestsController(TestController):
 
     def test_index(self):
         self.log_user()
@@ -143,7 +143,7 @@
                                  status=400)
         response.mustcontain('Invalid reviewer &#34;%s&#34; 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')
--- a/kallithea/tests/functional/test_repo_groups.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_repo_groups.py	Sun May 15 22:37:37 2016 +0200
@@ -1,7 +1,7 @@
 from kallithea.tests import *
 
 
-class TestRepoGroupsController(TestControllerPytest):
+class TestRepoGroupsController(TestController):
 
     def test_index(self):
         self.log_user()
--- a/kallithea/tests/functional/test_search.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_search.py	Sun May 15 22:37:37 2016 +0200
@@ -3,7 +3,7 @@
 from kallithea.tests import *
 
 
-class TestSearchController(TestControllerPytest):
+class TestSearchController(TestController):
 
     def test_index(self):
         self.log_user()
--- a/kallithea/tests/functional/test_summary.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_summary.py	Sun May 15 22:37:37 2016 +0200
@@ -22,7 +22,7 @@
 fixture = Fixture()
 
 
-class TestSummaryController(TestControllerPytest):
+class TestSummaryController(TestController):
 
     def test_index(self):
         self.log_user()
--- a/kallithea/tests/functional/test_tags.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/functional/test_tags.py	Sun May 15 22:37:37 2016 +0200
@@ -1,7 +1,7 @@
 from kallithea.tests import *
 
 
-class TestTagsController(TestControllerPytest):
+class TestTagsController(TestController):
 
     def test_index_hg(self):
         self.log_user()
--- a/kallithea/tests/models/test_changeset_status.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/models/test_changeset_status.py	Sun May 15 22:37:37 2016 +0200
@@ -7,7 +7,7 @@
     def __init__(self, status):
         self.status = status
 
-class TestChangesetStatusCalculation(TestControllerPytest):
+class TestChangesetStatusCalculation(TestController):
 
     def setup_method(self, method):
         self.m = ChangesetStatusModel()
--- a/kallithea/tests/models/test_diff_parsers.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/models/test_diff_parsers.py	Sun May 15 22:37:37 2016 +0200
@@ -271,7 +271,7 @@
 }
 
 
-class TestDiffLib(TestControllerPytest):
+class TestDiffLib(TestController):
 
     @parametrize('diff_fixture', DIFF_FIXTURES)
     def test_diff(self, diff_fixture):
--- a/kallithea/tests/models/test_notifications.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/models/test_notifications.py	Sun May 15 22:37:37 2016 +0200
@@ -7,7 +7,7 @@
 from kallithea.model.notification import NotificationModel
 
 
-class TestNotifications(TestControllerPytest):
+class TestNotifications(TestController):
 
     def setup_method(self, method):
         Session.remove()
--- a/kallithea/tests/models/test_permissions.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/models/test_permissions.py	Sun May 15 22:37:37 2016 +0200
@@ -15,7 +15,7 @@
 fixture = Fixture()
 
 
-class TestPermissions(TestControllerPytest):
+class TestPermissions(TestController):
 
     @classmethod
     def setup_class(cls):
--- a/kallithea/tests/models/test_repo_groups.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/models/test_repo_groups.py	Sun May 15 22:37:37 2016 +0200
@@ -34,7 +34,7 @@
     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)
--- a/kallithea/tests/models/test_repos.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/models/test_repos.py	Sun May 15 22:37:37 2016 +0200
@@ -10,7 +10,7 @@
 fixture = Fixture()
 
 
-class TestRepos(TestControllerPytest):
+class TestRepos(TestController):
 
     def teardown_method(self, method):
         Session.remove()
--- a/kallithea/tests/models/test_user_groups.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/models/test_user_groups.py	Sun May 15 22:37:37 2016 +0200
@@ -10,7 +10,7 @@
 fixture = Fixture()
 
 
-class TestUserGroups(TestControllerPytest):
+class TestUserGroups(TestController):
 
     def teardown_method(self, method):
         # delete all groups
--- a/kallithea/tests/models/test_users.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/models/test_users.py	Sun May 15 22:37:37 2016 +0200
@@ -12,7 +12,7 @@
 fixture = Fixture()
 
 
-class TestUser(TestControllerPytest):
+class TestUser(TestController):
 
     @classmethod
     def setup_class(cls):
@@ -99,7 +99,7 @@
         Session().commit()
 
 
-class TestUsers(TestControllerPytest):
+class TestUsers(TestController):
 
     def setup_method(self, method):
         self.u1 = UserModel().create_or_update(username=u'u1',
--- a/kallithea/tests/other/manual_test_vcs_operations.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/other/manual_test_vcs_operations.py	Sun May 15 22:37:37 2016 +0200
@@ -166,7 +166,7 @@
     assert 'master -> master' in stderr
 
 
-class TestVCSOperations(TestControllerPytest):
+class TestVCSOperations(TestController):
 
     @classmethod
     def setup_class(cls):
--- a/kallithea/tests/other/test_libs.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/other/test_libs.py	Sun May 15 22:37:37 2016 +0200
@@ -67,7 +67,7 @@
 ]
 
 
-class TestLibs(TestControllerPytest):
+class TestLibs(TestController):
 
     @parametrize('test_url,expected,expected_creds', TEST_URLS)
     def test_uri_filter(self, test_url, expected, expected_creds):
--- a/kallithea/tests/other/test_mail.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/other/test_mail.py	Sun May 15 22:37:37 2016 +0200
@@ -21,7 +21,7 @@
         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'
--- a/kallithea/tests/other/test_validators.py	Sat May 14 22:03:20 2016 +0200
+++ b/kallithea/tests/other/test_validators.py	Sun May 15 22:37:37 2016 +0200
@@ -15,7 +15,7 @@
 fixture = Fixture()
 
 
-class TestRepoGroups(TestControllerPytest):
+class TestRepoGroups(TestController):
 
     def teardown_method(self, method):
         Session.remove()