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
1a3ed4a7
Commit
1a3ed4a7
authored
Sep 16, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do directory setup when testing SSH handling
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
519db423
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
weblate/trans/tests/test_admin.py
weblate/trans/tests/test_admin.py
+3
-0
weblate/trans/tests/test_ssh.py
weblate/trans/tests/test_ssh.py
+4
-3
No files found.
weblate/trans/tests/test_admin.py
View file @
1a3ed4a7
...
...
@@ -24,6 +24,7 @@ from weblate.trans.util import add_configuration_error
from
weblate
import
appsettings
from
weblate.trans.tests
import
OverrideSettings
from
weblate.trans.tests.utils
import
get_test_file
from
weblate.trans.data
import
check_data_writable
import
os
...
...
@@ -47,6 +48,7 @@ class AdminTest(ViewTestCase):
@
OverrideSettings
(
DATA_DIR
=
OverrideSettings
.
TEMP_DIR
)
def
test_ssh_generate
(
self
):
check_data_writable
()
response
=
self
.
client
.
get
(
reverse
(
'admin-ssh'
))
self
.
assertContains
(
response
,
'Generate SSH key'
)
...
...
@@ -58,6 +60,7 @@ class AdminTest(ViewTestCase):
@
OverrideSettings
(
DATA_DIR
=
OverrideSettings
.
TEMP_DIR
)
def
test_ssh_add
(
self
):
check_data_writable
()
try
:
oldpath
=
os
.
environ
[
'PATH'
]
os
.
environ
[
'PATH'
]
=
':'
.
join
(
...
...
weblate/trans/tests/test_ssh.py
View file @
1a3ed4a7
...
...
@@ -24,6 +24,7 @@ from django.test import TestCase
from
weblate.trans.ssh
import
get_host_keys
,
create_ssh_wrapper
,
ssh_file
from
weblate.trans.tests.utils
import
get_test_file
from
weblate.trans.tests
import
OverrideSettings
from
weblate.trans.data
import
check_data_writable
from
weblate
import
appsettings
...
...
@@ -36,14 +37,14 @@ class SSHTest(TestCase):
'''
@
OverrideSettings
(
DATA_DIR
=
OverrideSettings
.
TEMP_DIR
)
def
test_parse
(
self
):
tempdir
=
os
.
path
.
join
(
appsettings
.
DATA_DIR
,
'ssh'
)
os
.
makedirs
(
tempdir
)
shutil
.
copy
(
TEST_HOSTS
,
tempdir
)
check_data_writable
()
shutil
.
copy
(
TEST_HOSTS
,
os
.
path
.
join
(
appsettings
.
DATA_DIR
,
'ssh'
))
hosts
=
get_host_keys
()
self
.
assertEqual
(
len
(
hosts
),
50
)
@
OverrideSettings
(
DATA_DIR
=
OverrideSettings
.
TEMP_DIR
)
def
test_create_ssh_wrapper
(
self
):
check_data_writable
()
filename
=
os
.
path
.
join
(
appsettings
.
DATA_DIR
,
'ssh'
,
'ssh-weblate-wrapper'
)
...
...
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