Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
3f60bd73
authored
Jul 17, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: fix tests
MagicMock.__init__'s name parameter doesnt set the name attribute.
parent
3c6a1b3e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
circle/vm/tests/test_models.py
+7
-6
No files found.
circle/vm/tests/test_models.py
View file @
3f60bd73
...
...
@@ -370,10 +370,10 @@ class InstanceActivityTestCase(TestCase):
subact
.
__enter__
.
assert_called
()
def
test_flush
(
self
):
insts
=
[
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
()
,
name
=
"1"
),
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
()
,
name
=
"2"
)]
print
insts
[
0
]
.
name
node
=
MagicMock
(
spec
=
Node
,
enabled
=
True
,
name
=
"node1"
)
insts
=
[
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
()),
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
())]
insts
[
0
]
.
name
=
insts
[
1
]
.
name
=
"x"
node
=
MagicMock
(
spec
=
Node
,
enabled
=
True
)
node
.
instance_set
.
all
.
return_value
=
insts
user
=
MagicMock
(
spec
=
User
)
user
.
is_superuser
=
MagicMock
(
return_value
=
True
)
...
...
@@ -391,8 +391,9 @@ class InstanceActivityTestCase(TestCase):
user
.
is_superuser
.
assert_called
()
def
test_flush_disabled_wo_user
(
self
):
insts
=
[
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
(),
name
=
"1"
),
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
(),
name
=
"2"
)]
insts
=
[
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
()),
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
())]
insts
[
0
]
.
name
=
insts
[
1
]
.
name
=
"x"
node
=
MagicMock
(
spec
=
Node
,
enabled
=
False
)
node
.
instance_set
.
all
.
return_value
=
insts
flush_op
=
FlushOperation
(
node
)
...
...
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