Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
d2bbdf9d
authored
Dec 01, 2013
by
Bach Dániel
Committed by
Guba Sándor
Dec 01, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: test for Interface.create()
parent
f87c1242
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletions
+20
-1
circle/vm/tests/test_models.py
+20
-1
No files found.
circle/vm/tests/test_models.py
View file @
d2bbdf9d
...
...
@@ -2,9 +2,12 @@ from django.test import TestCase
from
mock
import
Mock
from
..models
import
(
from
..models
.instance
import
(
InstanceTemplate
,
Instance
,
pre_state_changed
,
post_state_changed
)
from
..models.network
import
(
Interface
)
class
TemplateTestCase
(
TestCase
):
...
...
@@ -51,3 +54,19 @@ class InstanceTestCase(TestCase):
assert
mock
.
called
assert
i
.
save
.
called
assert
i
.
state
==
'RUNNING'
class
InterfaceTestCase
(
TestCase
):
def
test_interface_create
(
self
):
from
firewall.models
import
Vlan
,
Domain
from
django.contrib.auth.models
import
User
owner
=
User
()
owner
.
save
()
i
=
Instance
(
id
=
10
,
owner
=
owner
)
d
=
Domain
(
owner
=
owner
)
d
.
save
()
v
=
Vlan
(
vid
=
55
,
network4
=
'127.0.0.1/8'
,
network6
=
'2001::1/32'
,
domain
=
d
)
v
.
save
()
Interface
.
create
(
i
,
v
,
managed
=
True
,
owner
=
owner
)
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