Commit 693471c5 authored by Michal Čihař's avatar Michal Čihař

Convert SameCheckTest to shared codebase

parent 307269cd
......@@ -55,6 +55,7 @@ class CheckTestCase(TestCase):
self.test_empty = ('', '', '')
self.test_good_matching = None
self.test_good_none = ('string', 'string', '')
self.test_good_ignore = None
self.test_failure_1 = None
self.test_failure_2 = None
self.test_failure_3 = None
......@@ -83,6 +84,9 @@ class CheckTestCase(TestCase):
def test_single_good_none(self):
self.do_test(False, self.test_good_none)
def test_single_good_ignore(self):
self.do_test(False, self.test_good_ignore)
def test_single_empty(self):
self.do_test(False, self.test_empty)
......
......@@ -26,32 +26,17 @@ from django.test import TestCase
from weblate.trans.checks.same import (
SameCheck,
)
from weblate.trans.tests.test_checks import Language
from weblate.trans.tests.test_checks import Language, CheckTestCase
class SameCheckTest(TestCase):
class SameCheckTest(CheckTestCase):
def setUp(self):
super(SameCheckTest, self).setUp()
self.check = SameCheck()
def test_not_same(self):
self.assertFalse(self.check.check_single(
'source',
'translation',
'',
Language('cs'),
None,
0
))
def test_same(self):
self.assertTrue(self.check.check_single(
'source',
'source',
'',
Language('cs'),
None,
0
))
self.test_good_none = ('%(source)s', '%(source)s', 'python-format')
self.test_good_matching = ('source', 'translation', '')
self.test_good_ignore = ('alarm', 'alarm', '')
self.test_failure_1 = ('string', 'string', '')
def test_same_english(self):
self.assertFalse(self.check.check_single(
......@@ -62,13 +47,3 @@ class SameCheckTest(TestCase):
None,
0
))
def test_same_format(self):
self.assertFalse(self.check.check_single(
'%(source)s',
'%(source)s',
'python-format',
Language('cs'),
None,
0
))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment