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
c7b3c1e0
Commit
c7b3c1e0
authored
Feb 21, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add helper for getting test file names
parent
28fbad38
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
20 deletions
+40
-20
trans/tests/dictionary.py
trans/tests/dictionary.py
+3
-10
trans/tests/files.py
trans/tests/files.py
+3
-10
trans/tests/util.py
trans/tests/util.py
+34
-0
No files found.
trans/tests/dictionary.py
View file @
c7b3c1e0
...
@@ -25,16 +25,9 @@ Tests for dictionary manipulations.
...
@@ -25,16 +25,9 @@ Tests for dictionary manipulations.
from
trans.tests.views
import
ViewTestCase
from
trans.tests.views
import
ViewTestCase
from
trans.models
import
Dictionary
from
trans.models
import
Dictionary
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
import
os.path
from
trans.tests.util
import
get_test_file
TEST_DATA
=
os
.
path
.
join
(
TEST_TBX
=
get_test_file
(
'terms.tbx'
)
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'data'
)
TEST_TBX
=
os
.
path
.
join
(
TEST_DATA
,
'terms.tbx'
)
class
DictionaryTest
(
ViewTestCase
):
class
DictionaryTest
(
ViewTestCase
):
...
...
trans/tests/files.py
View file @
c7b3c1e0
...
@@ -24,16 +24,9 @@ Tests for import and export.
...
@@ -24,16 +24,9 @@ Tests for import and export.
from
trans.tests.views
import
ViewTestCase
from
trans.tests.views
import
ViewTestCase
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
import
os.path
from
trans.tests.util
import
get_test_file
TEST_DATA
=
os
.
path
.
join
(
TEST_PO
=
get_test_file
(
'cs.po'
)
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'data'
)
TEST_PO
=
os
.
path
.
join
(
TEST_DATA
,
'cs.po'
)
TRANSLATION_OURS
=
u'Nazdar světe!
\
n
'
TRANSLATION_OURS
=
u'Nazdar světe!
\
n
'
TRANSLATION_PO
=
u'Ahoj světe!
\
n
'
TRANSLATION_PO
=
u'Ahoj světe!
\
n
'
...
...
trans/tests/util.py
0 → 100644
View file @
c7b3c1e0
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import
os.path
# Directory holding test data
TEST_DATA
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'data'
)
def
get_test_file
(
name
):
'''
Retuns filename of test file.
'''
return
os
.
path
.
join
(
TEST_DATA
,
name
)
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