Changeset - 7f2aa3ec2931
[Not reviewed]
default
0 45 0
Thomas De Schampheleire - 10 years ago 2016-05-15 22:37:37
thomas.de.schampheleire@gmail.com
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.
45 files changed with 51 insertions and 51 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/__init__.py
Show inline comments
 
@@ -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
kallithea/tests/api/test_api_git.py
Show inline comments
 
@@ -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'
kallithea/tests/api/test_api_hg.py
Show inline comments
 
@@ -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'
kallithea/tests/functional/test_admin.py
Show inline comments
 
@@ -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):
kallithea/tests/functional/test_admin_auth_settings.py
Show inline comments
 
@@ -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')
kallithea/tests/functional/test_admin_defaults.py
Show inline comments
 
@@ -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()
kallithea/tests/functional/test_admin_gists.py
Show inline comments
 
@@ -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():
kallithea/tests/functional/test_admin_notifications.py
Show inline comments
 
@@ -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()
 

	
kallithea/tests/functional/test_admin_permissions.py
Show inline comments
 
@@ -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()
kallithea/tests/functional/test_admin_repo_groups.py
Show inline comments
 
from kallithea.tests import *
 

	
 
class TestRepoGroupsController(TestControllerPytest):
 
class TestRepoGroupsController(TestController):
 
    pass
kallithea/tests/functional/test_admin_repos.py
Show inline comments
 
@@ -27,7 +27,7 @@ def _get_permission_for_user(user, repo)
 
    return perm
 

	
 

	
 
class _BaseTestCase(TestControllerPytest):
 
class _BaseTestCase(TestController):
 
    """
 
    Write all tests here
 
    """
kallithea/tests/functional/test_admin_settings.py
Show inline comments
 
@@ -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()
kallithea/tests/functional/test_admin_user_groups.py
Show inline comments
 
@@ -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()
kallithea/tests/functional/test_admin_users.py
Show inline comments
 
@@ -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.
kallithea/tests/functional/test_branches.py
Show inline comments
 
from kallithea.tests import *
 

	
 

	
 
class TestBranchesController(TestControllerPytest):
 
class TestBranchesController(TestController):
 

	
 
    def test_index_hg(self):
 
        self.log_user()
kallithea/tests/functional/test_changelog.py
Show inline comments
 
from kallithea.tests import *
 

	
 

	
 
class TestChangelogController(TestControllerPytest):
 
class TestChangelogController(TestController):
 

	
 
    def test_index_hg(self):
 
        self.log_user()
kallithea/tests/functional/test_changeset.py
Show inline comments
 
from kallithea.tests import *
 

	
 
class TestChangesetController(TestControllerPytest):
 
class TestChangesetController(TestController):
 

	
 
    def test_index(self):
 
        response = self.app.get(url(controller='changeset', action='index',
kallithea/tests/functional/test_changeset_comments.py
Show inline comments
 
@@ -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():
kallithea/tests/functional/test_compare.py
Show inline comments
 
@@ -10,7 +10,7 @@ def _commit_div(sha, msg):
 
    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
kallithea/tests/functional/test_compare_local.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
from kallithea.tests import *
 

	
 
class TestCompareController(TestControllerPytest):
 
class TestCompareController(TestController):
 

	
 
    def test_compare_tag_hg(self):
 
        self.log_user()
kallithea/tests/functional/test_feed.py
Show inline comments
 
from kallithea.tests import *
 

	
 
class TestFeedController(TestControllerPytest):
 
class TestFeedController(TestController):
 

	
 
    def test_rss(self):
 
        self.log_user()
kallithea/tests/functional/test_files.py
Show inline comments
 
@@ -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()
kallithea/tests/functional/test_followers.py
Show inline comments
 
from kallithea.tests import *
 

	
 

	
 
class TestFollowersController(TestControllerPytest):
 
class TestFollowersController(TestController):
 

	
 
    def test_index_hg(self):
 
        self.log_user()
kallithea/tests/functional/test_forks.py
Show inline comments
 
@@ -12,7 +12,7 @@ from kallithea.model.meta import Session
 

	
 
fixture = Fixture()
 

	
 
class _BaseTestCase(TestControllerPytest):
 
class _BaseTestCase(TestController):
 
    """
 
    Write all tests here
 
    """
kallithea/tests/functional/test_home.py
Show inline comments
 
@@ -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()
kallithea/tests/functional/test_journal.py
Show inline comments
 
@@ -2,7 +2,7 @@ from kallithea.tests import *
 
import datetime
 

	
 

	
 
class TestJournalController(TestControllerPytest):
 
class TestJournalController(TestController):
 

	
 
    def test_index(self):
 
        self.log_user()
kallithea/tests/functional/test_login.py
Show inline comments
 
@@ -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() == []
kallithea/tests/functional/test_my_account.py
Show inline comments
 
@@ -10,7 +10,7 @@ from kallithea.model.meta import Session
 
fixture = Fixture()
 

	
 

	
 
class TestMyAccountController(TestControllerPytest):
 
class TestMyAccountController(TestController):
 
    test_user_1 = 'testme'
 

	
 
    @classmethod
kallithea/tests/functional/test_pullrequests.py
Show inline comments
 
@@ -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 &#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')
kallithea/tests/functional/test_repo_groups.py
Show inline comments
 
from kallithea.tests import *
 

	
 

	
 
class TestRepoGroupsController(TestControllerPytest):
 
class TestRepoGroupsController(TestController):
 

	
 
    def test_index(self):
 
        self.log_user()
kallithea/tests/functional/test_search.py
Show inline comments
 
@@ -3,7 +3,7 @@ import os
 
from kallithea.tests import *
 

	
 

	
 
class TestSearchController(TestControllerPytest):
 
class TestSearchController(TestController):
 

	
 
    def test_index(self):
 
        self.log_user()
kallithea/tests/functional/test_summary.py
Show inline comments
 
@@ -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()
kallithea/tests/functional/test_tags.py
Show inline comments
 
from kallithea.tests import *
 

	
 

	
 
class TestTagsController(TestControllerPytest):
 
class TestTagsController(TestController):
 

	
 
    def test_index_hg(self):
 
        self.log_user()
kallithea/tests/models/test_changeset_status.py
Show inline comments
 
@@ -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()
kallithea/tests/models/test_diff_parsers.py
Show inline comments
 
@@ -271,7 +271,7 @@ DIFF_FIXTURES = {
 
}
 

	
 

	
 
class TestDiffLib(TestControllerPytest):
 
class TestDiffLib(TestController):
 

	
 
    @parametrize('diff_fixture', DIFF_FIXTURES)
 
    def test_diff(self, diff_fixture):
kallithea/tests/models/test_notifications.py
Show inline comments
 
@@ -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()
kallithea/tests/models/test_permissions.py
Show inline comments
 
@@ -15,7 +15,7 @@ from kallithea.model.permission import P
 
fixture = Fixture()
 

	
 

	
 
class TestPermissions(TestControllerPytest):
 
class TestPermissions(TestController):
 

	
 
    @classmethod
 
    def setup_class(cls):
kallithea/tests/models/test_repo_groups.py
Show inline comments
 
@@ -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)
kallithea/tests/models/test_repos.py
Show inline comments
 
@@ -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()
kallithea/tests/models/test_user_groups.py
Show inline comments
 
@@ -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
kallithea/tests/models/test_users.py
Show inline comments
 
@@ -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',
kallithea/tests/other/manual_test_vcs_operations.py
Show inline comments
 
@@ -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):
kallithea/tests/other/test_libs.py
Show inline comments
 
@@ -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):
kallithea/tests/other/test_mail.py
Show inline comments
 
@@ -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'
kallithea/tests/other/test_validators.py
Show inline comments
 
@@ -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()
0 comments (0 inline, 0 general)