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
09693c80
Commit
09693c80
authored
Mar 18, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify creating of test projects
parent
c9399b67
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
trans/tests/models.py
trans/tests/models.py
+15
-6
trans/tests/views.py
trans/tests/views.py
+4
-4
No files found.
trans/tests/models.py
View file @
09693c80
...
...
@@ -92,10 +92,10 @@ class RepoTestCase(TestCase):
web
=
'http://weblate.org/'
)
def
create_subproject
(
self
,
file_format
=
'auto'
,
mask
=
'po/*.po'
,
def
_
create_subproject
(
self
,
file_format
=
'auto'
,
mask
=
'po/*.po'
,
template
=
''
,
repoweb
=
REPOWEB_URL
):
'''
Creates test subproject.
Creates
real
test subproject.
'''
project
=
self
.
create_project
()
return
SubProject
.
objects
.
create
(
...
...
@@ -110,28 +110,37 @@ class RepoTestCase(TestCase):
repoweb
=
repoweb
,
)
def
create_subproject
(
self
):
'''
Wrapper method for proving test subproject.
'''
return
self
.
_create_subproject
(
'auto'
,
'po/*.po'
,
)
def
create_iphone
(
self
):
return
self
.
create_subproject
(
return
self
.
_
create_subproject
(
'strings'
,
'iphone/*.lproj/Localizable.strings'
,
)
def
create_android
(
self
):
return
self
.
create_subproject
(
return
self
.
_
create_subproject
(
'aresource'
,
'android/values-*/strings.xml'
,
'android/values/strings.xml'
,
)
def
create_java
(
self
):
return
self
.
create_subproject
(
return
self
.
_
create_subproject
(
'properties'
,
'java/swing_messages_*.properties'
,
'java/swing_messages.properties'
,
)
def
create_xliff
(
self
):
return
self
.
create_subproject
(
return
self
.
_
create_subproject
(
'xliff'
,
'xliff/*/DPH.xlf'
,
)
...
...
trans/tests/views.py
View file @
09693c80
...
...
@@ -136,12 +136,12 @@ class BasicViewTest(ViewTestCase):
class
BasicResourceViewTest
(
BasicViewTest
):
def
create_subproject
(
self
,
*
args
,
**
kwargs
):
def
create_subproject
(
self
):
return
self
.
create_android
()
class
BasicIphoneViewTest
(
BasicViewTest
):
def
create_subproject
(
self
,
*
args
,
**
kwargs
):
def
create_subproject
(
self
):
return
self
.
create_iphone
()
...
...
@@ -222,10 +222,10 @@ class EditTest(ViewTestCase):
class
EditResourceTest
(
EditTest
):
def
create_subproject
(
self
,
*
args
,
**
kwargs
):
def
create_subproject
(
self
):
return
self
.
create_android
()
class
EditIphoneTest
(
EditTest
):
def
create_subproject
(
self
,
*
args
,
**
kwargs
):
def
create_subproject
(
self
):
return
self
.
create_iphone
()
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