Changeset - 5c9eb37bdec4
kallithea/tests/vcs/__init__.py
Show inline comments
 
@@ -6,28 +6,20 @@ run for each engine listed at ``conf.SCM
 
``vcs.backends.BACKENDS``.
 

	
 
For each SCM we run tests for, we need some repository. We would use
 
repositories location from system environment variables or test suite defaults
 
- see ``conf`` module for more detail. We simply try to check if repository at
 
certain location exists, if not we would try to fetch them. At ``test_vcs`` or
 
``test_common`` we run unit tests common for each repository type and for
 
example specific mercurial tests are located at ``test_hg`` module.
 

	
 
Oh, and tests are run with ``unittest.collector`` wrapped by ``collector``
 
function at ``tests/__init__.py``.
 

	
 
.. _vcs: http://bitbucket.org/marcinkuzminski/vcs
 
.. _unittest: http://pypi.python.org/pypi/unittest
 

	
 
repositories location provided in test suite defaults - see ``conf``
 
module for more detail. We simply try to check if repository at
 
certain location exists, if not we would try to fetch them. At
 
``test_vcs`` or ``test_common`` we run unit tests common for each
 
repository type and for example specific mercurial tests are located
 
at ``test_hg`` module.
 
"""
 

	
 
import os
 
import shutil
 

	
 
from kallithea.tests.base import TEST_HG_REPO, HG_REMOTE_REPO, TEST_GIT_REPO, GIT_REMOTE_REPO
 
from kallithea.tests.base import TEST_HG_REPO, HG_REMOTE_REPO, TEST_GIT_REPO, GIT_REMOTE_REPO, TESTS_TMP_PATH
 
from kallithea.tests.vcs.utils import SCMFetcher
 

	
 
from kallithea.tests.base import *
 

	
 

	
 
# Base directory for the VCS tests.
 
VCS_TEST_MODULE_BASE_DIR = os.path.abspath(os.path.dirname(__file__))
kallithea/tests/vcs/base.py
Show inline comments
 
@@ -6,12 +6,13 @@ import os
 
import time
 
import shutil
 
import datetime
 
from kallithea.tests.vcs.conf import SCM_TESTS, get_new_dir
 

	
 
from kallithea.lib import vcs
 
from kallithea.lib.vcs.utils.compat import unittest
 
from kallithea.lib.vcs.nodes import FileNode
 

	
 
from kallithea.tests.vcs.conf import SCM_TESTS, get_new_dir
 

	
 

	
 
class _BackendTestMixin(object):
 
    """
kallithea/tests/vcs/conf.py
Show inline comments
 
@@ -10,11 +10,14 @@ import uuid
 
from kallithea.tests.base import (
 
    TESTS_TMP_PATH, SCM_TESTS,
 
    TEST_HG_REPO, HG_REMOTE_REPO,
 
    TEST_HG_REPO_CLONE, TEST_HG_REPO_PULL,
 
    TEST_GIT_REPO, GIT_REMOTE_REPO,
 
    TEST_GIT_REPO_CLONE,
 
)
 

	
 
__all__ = (
 
    'TEST_HG_REPO', 'TEST_GIT_REPO', 'HG_REMOTE_REPO', 'GIT_REMOTE_REPO',
 
    'TEST_HG_REPO_CLONE', 'TEST_GIT_REPO_CLONE', 'TEST_HG_REPO_PULL',
 
    'SCM_TESTS',
 
)
 

	
 
@@ -54,7 +57,3 @@ def get_new_dir(title=None):
 
        hex_uuid = uuid.uuid4().hex
 

	
 
    return "%s-%s" % (path, hex_uuid)
 

	
 

	
 
# overide default configurations with kallithea ones
 
from kallithea.tests.base import *
kallithea/tests/vcs/test_archives.py
Show inline comments
 
@@ -5,11 +5,13 @@ import datetime
 
import tempfile
 
import StringIO
 

	
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 
from kallithea.lib.vcs.exceptions import VCSError
 
from kallithea.lib.vcs.nodes import FileNode
 

	
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS, TESTS_TMP_PATH
 
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):
kallithea/tests/vcs/test_changesets.py
Show inline comments
 
@@ -2,9 +2,10 @@
 

	
 
import time
 
import datetime
 

	
 
from kallithea.lib.vcs.utils.compat import unittest
 

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

	
 
from kallithea.lib.vcs.backends.base import BaseChangeset
 
from kallithea.lib.vcs.nodes import (
 
@@ -15,8 +16,9 @@ from kallithea.lib.vcs.exceptions import
 
    BranchDoesNotExistError, ChangesetDoesNotExistError,
 
    RepositoryError, EmptyRepositoryError
 
)
 
from kallithea.lib.vcs.utils.compat import unittest
 
from kallithea.tests.vcs.conf import get_new_dir
 

	
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS, get_new_dir
 

	
 

	
 
class TestBaseChangeset(unittest.TestCase):
kallithea/tests/vcs/test_filenodes_unicode_path.py
Show inline comments
 
# encoding: utf8
 

	
 
import datetime
 

	
 
import datetime
 
from kallithea.lib.vcs.nodes import FileNode
 
from kallithea.tests.vcs.test_inmemchangesets import BackendBaseTestCase
 
from kallithea.tests.vcs.conf import SCM_TESTS
kallithea/tests/vcs/test_getitem.py
Show inline comments
 
import datetime
 

	
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS
 
from kallithea.lib.vcs.nodes import FileNode
kallithea/tests/vcs/test_getslice.py
Show inline comments
 
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.conf import SCM_TESTS
 
from kallithea.lib.vcs.nodes import FileNode
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 

	
 
class GetsliceTestCaseMixin(_BackendTestMixin):
kallithea/tests/vcs/test_git.py
Show inline comments
 
@@ -11,6 +11,7 @@ from kallithea.lib.vcs.exceptions import
 
from kallithea.lib.vcs.nodes import NodeKind, FileNode, DirNode, NodeState
 
from kallithea.lib.vcs.utils.compat import unittest
 
from kallithea.model.scm import ScmModel
 

	
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import TEST_GIT_REPO, TEST_GIT_REPO_CLONE, TESTS_TMP_PATH, get_new_dir
 

	
kallithea/tests/vcs/test_hg.py
Show inline comments
 
@@ -6,6 +6,7 @@ from kallithea.lib.utils2 import safe_st
 
from kallithea.lib.vcs.backends.hg import MercurialRepository, MercurialChangeset
 
from kallithea.lib.vcs.exceptions import RepositoryError, VCSError, NodeDoesNotExistError
 
from kallithea.lib.vcs.nodes import NodeKind, NodeState
 

	
 
from kallithea.tests.vcs.conf import TEST_HG_REPO, TEST_HG_REPO_CLONE, \
 
    TEST_HG_REPO_PULL, TESTS_TMP_PATH
 
from kallithea.lib.vcs.utils.compat import unittest
kallithea/tests/vcs/test_inmemchangesets.py
Show inline comments
 
@@ -6,8 +6,9 @@ Tests so called "in memory changesets" c
 
import time
 
import datetime
 

	
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 
from kallithea.lib import vcs
 
from kallithea.tests.vcs.conf import SCM_TESTS, get_new_dir
 
from kallithea.lib.vcs.exceptions import EmptyRepositoryError
 
from kallithea.lib.vcs.exceptions import NodeAlreadyAddedError
 
from kallithea.lib.vcs.exceptions import NodeAlreadyExistsError
 
@@ -17,9 +18,10 @@ from kallithea.lib.vcs.exceptions import
 
from kallithea.lib.vcs.exceptions import NodeNotChangedError
 
from kallithea.lib.vcs.nodes import DirNode
 
from kallithea.lib.vcs.nodes import FileNode
 
from kallithea.lib.vcs.utils.compat import unittest
 
from kallithea.lib.vcs.utils import safe_unicode
 

	
 
from kallithea.tests.vcs.conf import SCM_TESTS, get_new_dir
 

	
 

	
 
class InMemoryChangesetTestMixin(object):
 
    """
kallithea/tests/vcs/test_nodes.py
Show inline comments
 
import stat
 
import mimetypes
 

	
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 
from kallithea.lib.vcs.nodes import DirNode
 
from kallithea.lib.vcs.nodes import FileNode
 
from kallithea.lib.vcs.nodes import Node
 
from kallithea.lib.vcs.nodes import NodeError
 
from kallithea.lib.vcs.nodes import NodeKind
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 

	
 
class NodeBasicTest(unittest.TestCase):
kallithea/tests/vcs/test_repository.py
Show inline comments
 
import datetime
 

	
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 
from kallithea.lib.vcs.nodes import FileNode
 
from kallithea.lib.vcs.exceptions import ChangesetDoesNotExistError
 

	
 
from kallithea.tests.vcs.base import _BackendTestMixin
 
from kallithea.tests.vcs.conf import SCM_TESTS
 
from kallithea.tests.vcs import TEST_USER_CONFIG_FILE
 
from kallithea.lib.vcs.nodes import FileNode
 
from kallithea.lib.vcs.utils.compat import unittest
 
from kallithea.lib.vcs.exceptions import ChangesetDoesNotExistError
 

	
 

	
 
class RepositoryBaseTest(_BackendTestMixin):
kallithea/tests/vcs/test_tags.py
Show inline comments
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 
from kallithea.lib.vcs.exceptions import TagAlreadyExistError
 
from kallithea.lib.vcs.exceptions import TagDoesNotExistError
 

	
 
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):
kallithea/tests/vcs/test_utils.py
Show inline comments
 
@@ -7,6 +7,7 @@ import shutil
 
import datetime
 

	
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 
from kallithea.lib.vcs.utils.paths import get_dirs_for_path
 
from kallithea.lib.vcs.utils.helpers import get_dict_for_attrs
 
from kallithea.lib.vcs.utils.helpers import get_scm
kallithea/tests/vcs/test_vcs.py
Show inline comments
 
import os
 
import shutil
 

	
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 
from kallithea.lib.utils2 import safe_str
 
from kallithea.lib.vcs import VCSError, get_repo, get_backend
 
from kallithea.lib.vcs.backends.hg import MercurialRepository
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 
from kallithea.tests.vcs.conf import TEST_HG_REPO, TEST_GIT_REPO, TESTS_TMP_PATH
 

	
 

	
kallithea/tests/vcs/test_workdirs.py
Show inline comments
 
import datetime
 

	
 
from kallithea.lib.vcs.utils.compat import unittest
 

	
 
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.conf import SCM_TESTS
 

	
0 comments (0 inline, 0 general)