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
85419695
Commit
85419695
authored
Feb 15, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test some repository error states
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
39e76f30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
weblate/trans/tests/test_subproject.py
weblate/trans/tests/test_subproject.py
+43
-0
No files found.
weblate/trans/tests/test_subproject.py
View file @
85419695
...
...
@@ -23,6 +23,7 @@ Tests for translation models.
"""
import
os
import
shutil
from
django.core.exceptions
import
ValidationError
...
...
@@ -531,3 +532,45 @@ class SubProjectValidationTest(RepoTestCase):
'Solution/Project/Resources.fr-fr.resx'
,
]
)
class
SubProjectErrorTest
(
RepoTestCase
):
"""Tests for error handling"""
def
setUp
(
self
):
super
(
SubProjectErrorTest
,
self
).
setUp
()
self
.
component
=
self
.
create_subproject
()
# Change to invalid pull/push URL
self
.
component
.
repository
.
configure_remote
(
'file:/dev/null'
,
'file:/dev/null'
,
'master'
)
def
test_failed_update
(
self
):
self
.
assertFalse
(
self
.
component
.
do_update
()
)
def
test_failed_update_remote
(
self
):
self
.
assertFalse
(
self
.
component
.
update_remote_branch
()
)
def
test_failed_push
(
self
):
testfile
=
os
.
path
.
join
(
self
.
component
.
get_path
(),
'README.md'
)
with
open
(
testfile
,
'a'
)
as
handle
:
handle
.
write
(
'CHANGE'
)
self
.
component
.
repository
.
commit
(
'test'
,
files
=
[
'README.md'
])
self
.
assertFalse
(
self
.
component
.
do_push
(
None
)
)
def
test_failed_reset
(
self
):
# Corrupt Git database so that reset fails
shutil
.
rmtree
(
os
.
path
.
join
(
self
.
component
.
get_path
(),
'.git'
,
'objects'
,
'pack'
)
)
self
.
assertFalse
(
self
.
component
.
do_reset
(
None
)
)
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