Changeset - c5829bc7d090
kallithea/tests/api/api_base.py
Show inline comments
 
@@ -88,7 +88,7 @@ def make_repo_group(name=TEST_REPO_GROUP
 
    return gr
 

	
 

	
 
class BaseTestApi(object):
 
class _BaseTestApi(object):
 
    REPO = None
 
    REPO_TYPE = None
 

	
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 *
 
from kallithea.tests.api.api_base import BaseTestApi
 
from kallithea.tests import TestController, GIT_REPO
 
from kallithea.tests.api.api_base import _BaseTestApi
 

	
 

	
 
class TestGitApi(BaseTestApi, TestController):
 
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 *
 
from kallithea.tests.api.api_base import BaseTestApi
 
from kallithea.tests import TestController, HG_REPO
 
from kallithea.tests.api.api_base import _BaseTestApi
 

	
 

	
 
class TestHgApi(BaseTestApi, TestController):
 
class TestHgApi(_BaseTestApi, TestController):
 
    REPO = HG_REPO
 
    REPO_TYPE = 'hg'
kallithea/tests/functional/test_admin_repos.py
Show inline comments
 
@@ -26,7 +26,7 @@ def _get_permission_for_user(user, repo)
 
    return perm
 

	
 

	
 
class _BaseTest(TestController):
 
class _BaseTest(object):
 
    """
 
    Write all tests here
 
    """
 
@@ -638,7 +638,7 @@ class _BaseTest(TestController):
 
        # repo must not be in filesystem !
 
        self.assertFalse(os.path.isdir(os.path.join(TESTS_TMP_PATH, repo_name)))
 

	
 
class TestAdminReposControllerGIT(_BaseTest):
 
class TestAdminReposControllerGIT(TestController, _BaseTest):
 
    REPO = GIT_REPO
 
    REPO_TYPE = 'git'
 
    NEW_REPO = NEW_GIT_REPO
 
@@ -646,7 +646,7 @@ class TestAdminReposControllerGIT(_BaseT
 
    OTHER_TYPE = 'hg'
 

	
 

	
 
class TestAdminReposControllerHG(_BaseTest):
 
class TestAdminReposControllerHG(TestController, _BaseTest):
 
    REPO = HG_REPO
 
    REPO_TYPE = 'hg'
 
    NEW_REPO = NEW_HG_REPO
kallithea/tests/functional/test_forks.py
Show inline comments
 
# -*- coding: utf-8 -*-
 

	
 
import unittest
 

	
 
from kallithea.tests import *
 
from kallithea.tests.fixture import Fixture
 

	
 
@@ -12,15 +15,7 @@ fixture = Fixture()
 
from kallithea.tests import *
 

	
 

	
 
class _BaseTest(TestController):
 
    """
 
    Write all tests here
 
    """
 
    REPO = None
 
    REPO_TYPE = None
 
    NEW_REPO = None
 
    REPO_FORK = None
 

	
 
class _BaseFixture(unittest.TestCase):
 
    @classmethod
 
    def setup_class(cls):
 
        pass
 
@@ -40,6 +35,16 @@ class _BaseTest(TestController):
 
        Session().delete(self.u1)
 
        Session().commit()
 

	
 

	
 
class _BaseTestCase(object):
 
    """
 
    Write all tests here
 
    """
 
    REPO = None
 
    REPO_TYPE = None
 
    NEW_REPO = None
 
    REPO_FORK = None
 

	
 
    def test_index(self):
 
        self.log_user()
 
        repo_name = self.REPO
 
@@ -218,14 +223,14 @@ class _BaseTest(TestController):
 
        response.mustcontain('There are no forks yet')
 

	
 

	
 
class TestGIT(_BaseTest):
 
class TestGIT(TestController, _BaseTestCase, _BaseFixture):
 
    REPO = GIT_REPO
 
    NEW_REPO = NEW_GIT_REPO
 
    REPO_TYPE = 'git'
 
    REPO_FORK = GIT_FORK
 

	
 

	
 
class TestHG(_BaseTest):
 
class TestHG(TestController, _BaseTestCase, _BaseFixture):
 
    REPO = HG_REPO
 
    NEW_REPO = NEW_HG_REPO
 
    REPO_TYPE = 'hg'
kallithea/tests/vcs/base.py
Show inline comments
 
@@ -13,7 +13,7 @@ from kallithea.lib.vcs.utils.compat impo
 
from kallithea.lib.vcs.nodes import FileNode
 

	
 

	
 
class BackendTestMixin(object):
 
class _BackendTestMixin(object):
 
    """
 
    This is a backend independent test case class which should be created
 
    with ``type`` method.
 
@@ -103,7 +103,7 @@ for alias in SCM_TESTS:
 
        'backend_alias': alias,
 
    }
 
    cls_name = ''.join(('%s base backend test' % alias).title().split())
 
    bases = (BackendTestMixin, unittest.TestCase)
 
    bases = (_BackendTestMixin, unittest.TestCase)
 
    globals()[cls_name] = type(cls_name, bases, attrs)
 

	
 

	
kallithea/tests/vcs/test_archives.py
Show inline comments
 
@@ -6,14 +6,14 @@ import zipfile
 
import datetime
 
import tempfile
 
import StringIO
 
from kallithea.tests.vcs.base import BackendTestMixin
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS
 
from kallithea.lib.vcs.exceptions import VCSError
 
from kallithea.lib.vcs.nodes import FileNode
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 

	
 
class ArchivesTestCaseMixin(BackendTestMixin):
 
class ArchivesTestCaseMixin(_BackendTestMixin):
 

	
 
    @classmethod
 
    def _get_commits(cls):
kallithea/tests/vcs/test_branches.py
Show inline comments
 
@@ -5,11 +5,11 @@ from kallithea.lib import vcs
 
from kallithea.lib.vcs.utils.compat import unittest
 
from kallithea.lib.vcs.nodes import FileNode
 

	
 
from kallithea.tests.vcs.base import BackendTestMixin
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS
 

	
 

	
 
class BranchesTestCaseMixin(BackendTestMixin):
 
class BranchesTestCaseMixin(_BackendTestMixin):
 

	
 
    @classmethod
 
    def _get_commits(cls):
kallithea/tests/vcs/test_changesets.py
Show inline comments
 
@@ -4,7 +4,7 @@ from __future__ import with_statement
 
import time
 
import datetime
 
from kallithea.lib import vcs
 
from kallithea.tests.vcs.base import BackendTestMixin
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS
 

	
 
from kallithea.lib.vcs.backends.base import BaseChangeset
 
@@ -50,7 +50,7 @@ class TestBaseChangeset(unittest.TestCas
 
            'removed': [],
 
        })
 

	
 
class ChangesetsWithCommitsTestCaseixin(BackendTestMixin):
 
class _ChangesetsWithCommitsTestCaseixin(_BackendTestMixin):
 
    recreate_repo_per_test = True
 

	
 
    @classmethod
 
@@ -146,7 +146,7 @@ class ChangesetsWithCommitsTestCaseixin(
 
            self.assertEqual([sha], self.repo.get_changeset(test_rev).children)
 

	
 

	
 
class ChangesetsTestCaseMixin(BackendTestMixin):
 
class _ChangesetsTestCaseMixin(_BackendTestMixin):
 
    recreate_repo_per_test = False
 

	
 
    @classmethod
 
@@ -301,7 +301,7 @@ class ChangesetsTestCaseMixin(BackendTes
 
            list(self.repo.get_changesets(start=last-1, end=0))
 

	
 

	
 
class ChangesetsChangesTestCaseMixin(BackendTestMixin):
 
class _ChangesetsChangesTestCaseMixin(_BackendTestMixin):
 
    recreate_repo_per_test = False
 

	
 
    @classmethod
 
@@ -373,17 +373,17 @@ for alias in SCM_TESTS:
 
    }
 
    # tests with additional commits
 
    cls_name = ''.join(('%s changesets with commits test' % alias).title().split())
 
    bases = (ChangesetsWithCommitsTestCaseixin, unittest.TestCase)
 
    bases = (_ChangesetsWithCommitsTestCaseixin, unittest.TestCase)
 
    globals()[cls_name] = type(cls_name, bases, attrs)
 

	
 
    # tests without additional commits
 
    cls_name = ''.join(('%s changesets test' % alias).title().split())
 
    bases = (ChangesetsTestCaseMixin, unittest.TestCase)
 
    bases = (_ChangesetsTestCaseMixin, unittest.TestCase)
 
    globals()[cls_name] = type(cls_name, bases, attrs)
 

	
 
    # tests changes
 
    cls_name = ''.join(('%s changesets changes test' % alias).title().split())
 
    bases = (ChangesetsChangesTestCaseMixin, unittest.TestCase)
 
    bases = (_ChangesetsChangesTestCaseMixin, unittest.TestCase)
 
    globals()[cls_name] = type(cls_name, bases, attrs)
 

	
 

	
kallithea/tests/vcs/test_getitem.py
Show inline comments
 
from __future__ import with_statement
 

	
 
import datetime
 
from kallithea.tests.vcs.base import BackendTestMixin
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS
 
from kallithea.lib.vcs.nodes import FileNode
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 

	
 
class GetitemTestCaseMixin(BackendTestMixin):
 
class GetitemTestCaseMixin(_BackendTestMixin):
 

	
 
    @classmethod
 
    def _get_commits(cls):
kallithea/tests/vcs/test_getslice.py
Show inline comments
 
from __future__ import with_statement
 

	
 
import datetime
 
from kallithea.tests.vcs.base import BackendTestMixin
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS
 
from kallithea.lib.vcs.nodes import FileNode
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 

	
 
class GetsliceTestCaseMixin(BackendTestMixin):
 
class GetsliceTestCaseMixin(_BackendTestMixin):
 

	
 
    @classmethod
 
    def _get_commits(cls):
kallithea/tests/vcs/test_git.py
Show inline comments
 
@@ -8,7 +8,7 @@ from kallithea.lib.vcs.backends.git impo
 
from kallithea.lib.vcs.exceptions import RepositoryError, VCSError, NodeDoesNotExistError
 
from kallithea.lib.vcs.nodes import NodeKind, FileNode, DirNode, NodeState
 
from kallithea.lib.vcs.utils.compat import unittest
 
from kallithea.tests.vcs.base import BackendTestMixin
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import TEST_GIT_REPO, TEST_GIT_REPO_CLONE, get_new_dir
 

	
 

	
 
@@ -620,7 +620,7 @@ class GitSpecificTest(unittest.TestCase)
 
            changeset.added
 

	
 

	
 
class GitSpecificWithRepoTest(BackendTestMixin, unittest.TestCase):
 
class GitSpecificWithRepoTest(_BackendTestMixin, unittest.TestCase):
 
    backend_alias = 'git'
 

	
 
    @classmethod
 
@@ -688,7 +688,7 @@ class GitSpecificWithRepoTest(BackendTes
 
            % (3, self.repo._get_revision(0), self.repo._get_revision(1)))
 

	
 

	
 
class GitRegressionTest(BackendTestMixin, unittest.TestCase):
 
class GitRegressionTest(_BackendTestMixin, unittest.TestCase):
 
    backend_alias = 'git'
 

	
 
    @classmethod
kallithea/tests/vcs/test_repository.py
Show inline comments
 
from __future__ import with_statement
 
import datetime
 
from kallithea.tests.vcs.base import BackendTestMixin
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS
 
from kallithea.tests.vcs.conf import TEST_USER_CONFIG_FILE
 
from kallithea.lib.vcs.nodes import FileNode
 
@@ -8,7 +8,7 @@ from kallithea.lib.vcs.utils.compat impo
 
from kallithea.lib.vcs.exceptions import ChangesetDoesNotExistError
 

	
 

	
 
class RepositoryBaseTest(BackendTestMixin):
 
class RepositoryBaseTest(_BackendTestMixin):
 
    recreate_repo_per_test = False
 

	
 
    @classmethod
 
@@ -46,7 +46,7 @@ class RepositoryBaseTest(BackendTestMixi
 
        self.assertTrue(self.repo != dummy())
 

	
 

	
 
class RepositoryGetDiffTest(BackendTestMixin):
 
class RepositoryGetDiffTest(_BackendTestMixin):
 

	
 
    @classmethod
 
    def _get_commits(cls):
kallithea/tests/vcs/test_tags.py
Show inline comments
 
from __future__ import with_statement
 

	
 
from kallithea.tests.vcs.base import BackendTestMixin
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS
 
from kallithea.lib.vcs.exceptions import TagAlreadyExistError
 
from kallithea.lib.vcs.exceptions import TagDoesNotExistError
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 

	
 
class TagsTestCaseMixin(BackendTestMixin):
 
class TagsTestCaseMixin(_BackendTestMixin):
 

	
 
    def test_new_tag(self):
 
        tip = self.repo.get_changeset()
kallithea/tests/vcs/test_workdirs.py
Show inline comments
 
@@ -3,11 +3,11 @@ from __future__ import with_statement
 
import datetime
 
from kallithea.lib.vcs.nodes import FileNode
 
from kallithea.lib.vcs.utils.compat import unittest
 
from kallithea.tests.vcs.base import BackendTestMixin
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS
 

	
 

	
 
class WorkdirTestCaseMixin(BackendTestMixin):
 
class WorkdirTestCaseMixin(_BackendTestMixin):
 

	
 
    @classmethod
 
    def _get_commits(cls):
0 comments (0 inline, 0 general)