Changeset - 67cb7f56d7f4
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 8 years ago 2018-03-16 21:15:38
thomas.de_schampheleire@nokia.com
tests: vcs: use _BackendTestMixin instead of duplicated BackendBaseTestCase in test_filenodes_unicode_path

test_inmemchangesets.py hosts a second base class in addition to
_BackendTestMixin, which is basically a duplication we want to get rid of.

As that duplicated base class BackendBaseTestCase is still in use by
test_filenodes_unicode_path.py, we first need to let that test use the main
base class.
1 file changed with 9 insertions and 8 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/vcs/test_filenodes_unicode_path.py
Show inline comments
 
@@ -3,17 +3,18 @@
 
import datetime
 

	
 
from kallithea.lib.vcs.nodes import FileNode
 
from kallithea.tests.vcs.test_inmemchangesets import BackendBaseTestCase
 
from kallithea.tests.vcs.base import _BackendTestMixin
 

	
 

	
 
class FileNodeUnicodePathTestsMixin(object):
 
class FileNodeUnicodePathTestsMixin(_BackendTestMixin):
 

	
 
    fname = 'ąśðąęłąć.txt'
 
    ufname = (fname).decode('utf-8')
 

	
 
    def get_commits(self):
 
        self.nodes = [
 
            FileNode(self.fname, content='Foobar'),
 
    @classmethod
 
    def _get_commits(cls):
 
        cls.nodes = [
 
            FileNode(cls.fname, content='Foobar'),
 
        ]
 

	
 
        commits = [
 
@@ -21,7 +22,7 @@ class FileNodeUnicodePathTestsMixin(obje
 
                'message': 'Initial commit',
 
                'author': 'Joe Doe <joe.doe@example.com>',
 
                'date': datetime.datetime(2010, 1, 1, 20),
 
                'added': self.nodes,
 
                'added': cls.nodes,
 
            },
 
        ]
 
        return commits
 
@@ -32,9 +33,9 @@ class FileNodeUnicodePathTestsMixin(obje
 
        assert node == unode
 

	
 

	
 
class TestGitFileNodeUnicodePath(FileNodeUnicodePathTestsMixin, BackendBaseTestCase):
 
class TestGitFileNodeUnicodePath(FileNodeUnicodePathTestsMixin):
 
    backend_alias = 'git'
 

	
 

	
 
class TestHgFileNodeUnicodePath(FileNodeUnicodePathTestsMixin, BackendBaseTestCase):
 
class TestHgFileNodeUnicodePath(FileNodeUnicodePathTestsMixin):
 
    backend_alias = 'hg'
0 comments (0 inline, 0 general)