changeset 7210:67cb7f56d7f4

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.
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Fri, 16 Mar 2018 21:15:38 +0100
parents 45a281a0f36f
children d8f820acf417
files kallithea/tests/vcs/test_filenodes_unicode_path.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/tests/vcs/test_filenodes_unicode_path.py	Fri Feb 23 13:29:03 2018 +0100
+++ b/kallithea/tests/vcs/test_filenodes_unicode_path.py	Fri Mar 16 21:15:38 2018 +0100
@@ -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 @@
                 '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 @@
         assert node == unode
 
 
-class TestGitFileNodeUnicodePath(FileNodeUnicodePathTestsMixin, BackendBaseTestCase):
+class TestGitFileNodeUnicodePath(FileNodeUnicodePathTestsMixin):
     backend_alias = 'git'
 
 
-class TestHgFileNodeUnicodePath(FileNodeUnicodePathTestsMixin, BackendBaseTestCase):
+class TestHgFileNodeUnicodePath(FileNodeUnicodePathTestsMixin):
     backend_alias = 'hg'