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
5efb57c7
Commit
5efb57c7
authored
Nov 14, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for Mercurial support
Fixes #511 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
f0e2fbb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
weblate/trans/tests/test_models.py
weblate/trans/tests/test_models.py
+27
-3
weblate/trans/tests/test_views.py
weblate/trans/tests/test_views.py
+10
-0
No files found.
weblate/trans/tests/test_models.py
View file @
5efb57c7
...
...
@@ -120,23 +120,36 @@ class RepoTestCase(TestCase):
self
.
addCleanup
(
shutil
.
rmtree
,
project
.
get_path
(),
True
)
return
project
def
_create_subproject
(
self
,
file_format
,
mask
,
template
=
''
,
new_base
=
''
):
def
_create_subproject
(
self
,
file_format
,
mask
,
template
=
''
,
new_base
=
''
,
vcs
=
'git'
):
"""
Creates real test subproject.
"""
project
=
self
.
create_project
()
if
vcs
==
'mercurial'
:
branch
=
'default'
repo
=
self
.
hg_repo_path
push
=
self
.
hg_repo_path
else
:
branch
=
'master'
repo
=
self
.
git_repo_path
push
=
self
.
git_repo_path
return
SubProject
.
objects
.
create
(
name
=
'Test'
,
slug
=
'test'
,
project
=
project
,
repo
=
self
.
git_repo_path
,
push
=
self
.
git_repo_path
,
repo
=
repo
,
push
=
push
,
branch
=
branch
,
filemask
=
mask
,
template
=
template
,
file_format
=
file_format
,
repoweb
=
REPOWEB_URL
,
save_history
=
True
,
new_base
=
new_base
,
vcs
=
vcs
)
def
create_subproject
(
self
):
...
...
@@ -154,6 +167,13 @@ class RepoTestCase(TestCase):
'po/*.po'
,
)
def
create_po_mercurial
(
self
):
return
self
.
_create_subproject
(
'po'
,
'po/*.po'
,
vcs
=
'mercurial'
)
def
create_po_new_base
(
self
):
return
self
.
_create_subproject
(
'po'
,
...
...
@@ -419,6 +439,10 @@ class SubProjectTest(RepoTestCase):
project
=
self
.
create_po
()
self
.
verify_subproject
(
project
,
3
,
'cs'
,
4
)
def
test_create_po_mercurial
(
self
):
project
=
self
.
create_po_mercurial
()
self
.
verify_subproject
(
project
,
3
,
'cs'
,
4
)
def
test_create_po_link
(
self
):
project
=
self
.
create_po_link
()
self
.
verify_subproject
(
project
,
3
,
'cs'
,
4
)
...
...
weblate/trans/tests/test_views.py
View file @
5efb57c7
...
...
@@ -334,6 +334,11 @@ class BasicResourceViewTest(BasicViewTest):
return
self
.
create_android
()
class
BasicMercurialViewTest
(
BasicViewTest
):
def
create_subproject
(
self
):
return
self
.
create_po_mercurial
()
class
BasicPoMonoViewTest
(
BasicViewTest
):
def
create_subproject
(
self
):
return
self
.
create_po_mono
()
...
...
@@ -680,6 +685,11 @@ class EditResourceTest(EditTest):
return
self
.
create_android
()
class
EditMercurialTest
(
EditTest
):
def
create_subproject
(
self
):
return
self
.
create_po_mercurial
()
class
EditPoMonoTest
(
EditTest
):
def
create_subproject
(
self
):
return
self
.
create_po_mono
()
...
...
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