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
b1985b2a
Commit
b1985b2a
authored
Feb 15, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test error paths in parsing storages
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
9a087355
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
weblate/trans/tests/test_subproject.py
weblate/trans/tests/test_subproject.py
+25
-1
No files found.
weblate/trans/tests/test_subproject.py
View file @
b1985b2a
...
...
@@ -27,6 +27,7 @@ import shutil
from
django.core.exceptions
import
ValidationError
from
weblate.trans.formats
import
ParseError
from
weblate.trans.models
import
(
Project
,
SubProject
,
Unit
,
Suggestion
,
IndexUpdate
,
)
...
...
@@ -543,7 +544,7 @@ class SubProjectErrorTest(RepoTestCase):
def
setUp
(
self
):
super
(
SubProjectErrorTest
,
self
).
setUp
()
self
.
component
=
self
.
create_
subproject
()
self
.
component
=
self
.
create_
ts_mono
()
# Change to invalid pull/push URL
self
.
component
.
repository
.
configure_remote
(
'file:/dev/null'
,
...
...
@@ -578,3 +579,26 @@ class SubProjectErrorTest(RepoTestCase):
self
.
assertFalse
(
self
.
component
.
do_reset
(
None
)
)
def
test_invalid_storage
(
self
):
testfile
=
os
.
path
.
join
(
self
.
component
.
get_path
(),
'ts-mono'
,
'cs.ts'
)
with
open
(
testfile
,
'a'
)
as
handle
:
handle
.
write
(
'CHANGE'
)
translation
=
self
.
component
.
translation_set
.
get
(
language_code
=
'cs'
)
self
.
assertRaises
(
ParseError
,
lambda
:
translation
.
store
)
def
test_invalid_template_storage
(
self
):
testfile
=
os
.
path
.
join
(
self
.
component
.
get_path
(),
'ts-mono'
,
'en.ts'
)
with
open
(
testfile
,
'a'
)
as
handle
:
handle
.
write
(
'CHANGE'
)
# Clean class cache, pylint: disable=W0212
self
.
component
.
_template_store
=
None
self
.
assertRaises
(
ParseError
,
lambda
:
self
.
component
.
template_store
)
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