Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
104
Merge Requests
104
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
63131789
Commit
63131789
authored
Feb 06, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proftpd/test: a bit better type annotations
parent
e58606b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
software/proftpd/test/test.py
software/proftpd/test/test.py
+10
-3
No files found.
software/proftpd/test/test.py
View file @
63131789
...
...
@@ -41,14 +41,20 @@ from paramiko.ssh_exception import AuthenticationException
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
from
slapos.testing.utils
import
findFreeTCPPort
from
typing
import
Dict
from
typing
import
Dict
,
TYPE_CHECKING
setUpModule
,
SlapOSInstanceTestCase
=
makeModuleSetUpAndTestCaseClass
(
setUpModule
,
_
SlapOSInstanceTestCase
=
makeModuleSetUpAndTestCaseClass
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software.cfg'
)))
class
ProFTPdTestCase
(
SlapOSInstanceTestCase
):
# type: ignore
if
TYPE_CHECKING
:
from
slapos.testing.testcase
import
SlapOSInstanceTestCase
else
:
SlapOSInstanceTestCase
=
_SlapOSInstanceTestCase
class
ProFTPdTestCase
(
SlapOSInstanceTestCase
):
def
_getConnection
(
self
,
username
:
str
=
None
,
password
:
str
=
None
,
hostname
:
str
=
None
)
->
pysftp
.
Connection
:
"""Returns a pysftp connection connected to the SFTP
...
...
@@ -198,6 +204,7 @@ class TestBan(ProFTPdTestCase):
class
TestInstanceParameterPort
(
ProFTPdTestCase
):
free_port
:
int
@
classmethod
def
getInstanceParameterDict
(
cls
)
->
Dict
[
str
,
str
]:
cls
.
free_port
=
findFreeTCPPort
(
cls
.
_ipv4_address
)
...
...
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