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
06d36db3
Commit
06d36db3
authored
Mar 03, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for Java properties file format
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
e105a42f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
weblate/trans/tests/data/swing.properties
weblate/trans/tests/data/swing.properties
+13
-0
weblate/trans/tests/test_formats.py
weblate/trans/tests/test_formats.py
+18
-3
No files found.
weblate/trans/tests/data/swing.properties
0 → 100644
View file @
06d36db3
IGNORE
=
Ignore
IGNOREALL
=
Ignore All
ADD
=
Add to Dictionary
REPLACE
=
Change
REPLACEALL
=
Change All
CANCEL
=
Cancel
SUGGESTIONS
=
Suggestions
INVALIDWORD
=
Not in Dictionary
COMPLETED
=
Spellcheck completed.
ADDWORD_1
=
Add
ADDWORD_2
=
to dictionary?
ADDWORD_3
=
Add Word?
weblate/trans/tests/test_formats.py
View file @
06d36db3
...
...
@@ -23,11 +23,12 @@ File format specific behavior.
import
tempfile
from
unittest
import
TestCase
from
weblate.trans.formats
import
(
AutoFormat
,
PoFormat
,
AndroidFormat
,
AutoFormat
,
PoFormat
,
AndroidFormat
,
PropertiesFormat
,
)
from
weblate.trans.tests.utils
import
get_test_file
TEST_PO
=
get_test_file
(
'cs.po'
)
TEST_PROPERTIES
=
get_test_file
(
'swing.properties'
)
TEST_ANDROID
=
get_test_file
(
'strings.xml'
)
TEST_POT
=
get_test_file
(
'hello.pot'
)
...
...
@@ -42,6 +43,8 @@ class AutoFormatTest(TestCase):
MATCH
=
'msgid_plural'
MASK
=
'po/*.po'
EXPECTED_PATH
=
'po/cs_CZ.po'
FIND
=
u'Hello, world!
\
n
'
MATCH
=
u'Ahoj světe!
\
n
'
def
test_parse
(
self
):
storage
=
self
.
FORMAT
(
self
.
FILE
)
...
...
@@ -51,12 +54,12 @@ class AutoFormatTest(TestCase):
def
test_find
(
self
):
storage
=
self
.
FORMAT
(
self
.
FILE
)
unit
,
add
=
storage
.
find_unit
(
''
,
'Hello, world!
\
n
'
)
unit
,
add
=
storage
.
find_unit
(
''
,
self
.
FIND
)
self
.
assertFalse
(
add
)
if
self
.
COUNT
==
0
:
self
.
assertTrue
(
unit
is
None
)
else
:
self
.
assertEqual
(
unit
.
get_target
(),
u'Ahoj světe!
\
n
'
)
self
.
assertEqual
(
unit
.
get_target
(),
self
.
MATCH
)
def
test_add
(
self
):
if
self
.
FORMAT
.
supports_new_language
():
...
...
@@ -80,6 +83,18 @@ class PoFormatTest(AutoFormatTest):
FORMAT
=
PoFormat
class
PropertiesFormatTest
(
AutoFormatTest
):
FORMAT
=
PropertiesFormat
FILE
=
TEST_PROPERTIES
MIME
=
'text/plain'
COUNT
=
12
EXT
=
'properties'
MASK
=
'java/swing_messages_*.properties'
EXPECTED_PATH
=
'java/swing_messages_cs_CZ.properties'
FIND
=
'IGNORE'
MATCH
=
'Ignore'
class
AndroidFormatTest
(
AutoFormatTest
):
FORMAT
=
AndroidFormat
FILE
=
TEST_ANDROID
...
...
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