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
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):
...
@@ -370,10 +370,10 @@ class InstanceActivityTestCase(TestCase):
subact
.
__enter__
.
assert_called
()
subact
.
__enter__
.
assert_called
()
def
test_flush
(
self
):
def
test_flush
(
self
):
insts
=
[
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
()
,
name
=
"1"
),
insts
=
[
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
()),
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
()
,
name
=
"2"
)]
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
())]
print
insts
[
0
]
.
name
insts
[
0
]
.
name
=
insts
[
1
]
.
name
=
"x"
node
=
MagicMock
(
spec
=
Node
,
enabled
=
True
,
name
=
"node1"
)
node
=
MagicMock
(
spec
=
Node
,
enabled
=
True
)
node
.
instance_set
.
all
.
return_value
=
insts
node
.
instance_set
.
all
.
return_value
=
insts
user
=
MagicMock
(
spec
=
User
)
user
=
MagicMock
(
spec
=
User
)
user
.
is_superuser
=
MagicMock
(
return_value
=
True
)
user
.
is_superuser
=
MagicMock
(
return_value
=
True
)
...
@@ -391,8 +391,9 @@ class InstanceActivityTestCase(TestCase):
...
@@ -391,8 +391,9 @@ class InstanceActivityTestCase(TestCase):
user
.
is_superuser
.
assert_called
()
user
.
is_superuser
.
assert_called
()
def
test_flush_disabled_wo_user
(
self
):
def
test_flush_disabled_wo_user
(
self
):
insts
=
[
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
(),
name
=
"1"
),
insts
=
[
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
()),
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
(),
name
=
"2"
)]
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
())]
insts
[
0
]
.
name
=
insts
[
1
]
.
name
=
"x"
node
=
MagicMock
(
spec
=
Node
,
enabled
=
False
)
node
=
MagicMock
(
spec
=
Node
,
enabled
=
False
)
node
.
instance_set
.
all
.
return_value
=
insts
node
.
instance_set
.
all
.
return_value
=
insts
flush_op
=
FlushOperation
(
node
)
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