Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d624a860
authored
Jan 31, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: test Lease
parent
23a8d45a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
circle/vm/tests/test_models.py
+27
-0
No files found.
circle/vm/tests/test_models.py
View file @
d624a860
...
@@ -8,6 +8,9 @@ from ..models.instance import (
...
@@ -8,6 +8,9 @@ from ..models.instance import (
from
..models.network
import
(
from
..models.network
import
(
Interface
Interface
)
)
from
..models.common
import
(
Lease
)
class
TemplateTestCase
(
TestCase
):
class
TemplateTestCase
(
TestCase
):
...
@@ -70,3 +73,27 @@ class InterfaceTestCase(TestCase):
...
@@ -70,3 +73,27 @@ class InterfaceTestCase(TestCase):
network6
=
'2001::1/32'
,
domain
=
d
)
network6
=
'2001::1/32'
,
domain
=
d
)
v
.
save
()
v
.
save
()
Interface
.
create
(
i
,
v
,
managed
=
True
,
owner
=
owner
)
Interface
.
create
(
i
,
v
,
managed
=
True
,
owner
=
owner
)
class
LeaseTestCase
(
TestCase
):
fixtures
=
[
'lease.json'
]
def
test_methods
(
self
):
from
datetime
import
timedelta
td
=
timedelta
(
seconds
=
1
)
l
=
Lease
.
objects
.
get
(
pk
=
1
)
assert
"never"
not
in
unicode
(
l
)
assert
l
.
delete_interval
>
td
assert
l
.
suspend_interval
>
td
l
.
delete_interval
=
None
assert
"never"
in
unicode
(
l
)
assert
l
.
delete_interval
is
None
l
.
delete_interval
=
td
*
2
assert
"never"
not
in
unicode
(
l
)
l
.
suspend_interval
=
None
assert
"never"
in
unicode
(
l
)
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