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
78e66c90
Commit
78e66c90
authored
Aug 13, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test content based guess from ttkit
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
8af07c50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
weblate/trans/tests/test_formats.py
weblate/trans/tests/test_formats.py
+12
-0
No files found.
weblate/trans/tests/test_formats.py
View file @
78e66c90
...
...
@@ -21,6 +21,7 @@
File format specific behavior.
'''
import
tempfile
from
StringIO
import
StringIO
from
unittest
import
TestCase
from
weblate.trans.formats
import
(
AutoFormat
,
PoFormat
,
AndroidFormat
,
PropertiesFormat
,
...
...
@@ -28,6 +29,7 @@ from weblate.trans.formats import (
FILE_FORMATS
,
)
from
weblate.trans.tests.utils
import
get_test_file
from
translate.storage.po
import
pofile
TEST_PO
=
get_test_file
(
'cs.po'
)
TEST_JSON
=
get_test_file
(
'cs.json'
)
...
...
@@ -69,6 +71,16 @@ class AutoLoadTest(TestCase):
if
'resx'
in
FILE_FORMATS
:
self
.
single_test
(
TEST_RESX
,
RESXFormat
)
def
test_content
(
self
):
"""Test content based guess from ttkit"""
with
open
(
TEST_PO
,
'r'
)
as
handle
:
data
=
handle
.
read
()
handle
=
StringIO
(
data
)
store
=
AutoFormat
.
parse
(
handle
)
self
.
assertIsInstance
(
store
,
AutoFormat
)
self
.
assertIsInstance
(
store
.
store
,
pofile
)
class
AutoFormatTest
(
TestCase
):
FORMAT
=
AutoFormat
...
...
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