Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
693471c5
Commit
693471c5
authored
Jan 23, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert SameCheckTest to shared codebase
parent
307269cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
32 deletions
+11
-32
weblate/trans/tests/test_checks.py
weblate/trans/tests/test_checks.py
+4
-0
weblate/trans/tests/test_same_checks.py
weblate/trans/tests/test_same_checks.py
+7
-32
No files found.
weblate/trans/tests/test_checks.py
View file @
693471c5
...
...
@@ -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
)
...
...
weblate/trans/tests/test_same_checks.py
View file @
693471c5
...
...
@@ -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
(
Check
TestCase
):
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
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment