Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
043a8ccf
authored
Feb 28, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: tests for finding unused ports
parent
f70812a3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
circle/vm/tests/test_models.py
+16
-4
No files found.
circle/vm/tests/test_models.py
View file @
043a8ccf
from
django.test
import
TestCase
from
django.test
import
TestCase
from
..models.common
import
(
Lease
)
from
..models.instance
import
(
from
..models.instance
import
(
InstanceTemplate
,
Instance
find_unused_port
,
InstanceTemplate
,
Instance
)
)
from
..models.network
import
(
from
..models.network
import
(
Interface
Interface
)
)
from
..models.common
import
(
Lease
)
class
PortFinderTestCase
(
TestCase
):
def
test_find_unused_port_without_used_ports
(
self
):
port
=
find_unused_port
(
port_range
=
(
1000
,
2000
))
assert
port
is
not
None
def
test_find_unused_port_with_fully_saturated_range
(
self
):
r
=
(
10
,
20
)
port
=
find_unused_port
(
port_range
=
r
,
used_ports
=
range
(
*
r
))
assert
port
is
None
class
TemplateTestCase
(
TestCase
):
class
TemplateTestCase
(
TestCase
):
...
...
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