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
3c6a1b3e
authored
Jul 17, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: fix tests
parent
74c3886a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
circle/dashboard/tests/test_mockedviews.py
+1
-1
circle/vm/tests/test_models.py
+6
-5
No files found.
circle/dashboard/tests/test_mockedviews.py
View file @
3c6a1b3e
...
@@ -47,7 +47,7 @@ class ViewUserTestCase(unittest.TestCase):
...
@@ -47,7 +47,7 @@ class ViewUserTestCase(unittest.TestCase):
go
.
return_value
=
MagicMock
(
spec
=
InstanceActivity
)
go
.
return_value
=
MagicMock
(
spec
=
InstanceActivity
)
go
.
return_value
.
_meta
.
object_name
=
"InstanceActivity"
go
.
return_value
.
_meta
.
object_name
=
"InstanceActivity"
view
=
InstanceActivityDetail
.
as_view
()
view
=
InstanceActivityDetail
.
as_view
()
self
.
assertEquals
(
view
(
request
,
pk
=
1234
)
.
status_code
,
302
)
self
.
assertEquals
(
view
(
request
,
pk
=
1234
)
.
status_code
,
200
)
def
test_found
(
self
):
def
test_found
(
self
):
request
=
FakeRequestFactory
(
superuser
=
True
)
request
=
FakeRequestFactory
(
superuser
=
True
)
...
...
circle/vm/tests/test_models.py
View file @
3c6a1b3e
...
@@ -370,9 +370,10 @@ class InstanceActivityTestCase(TestCase):
...
@@ -370,9 +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
()),
insts
=
[
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
(),
name
=
"1"
),
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
())]
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
(),
name
=
"2"
)]
node
=
MagicMock
(
spec
=
Node
,
enabled
=
True
)
print
insts
[
0
]
.
name
node
=
MagicMock
(
spec
=
Node
,
enabled
=
True
,
name
=
"node1"
)
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
)
...
@@ -390,8 +391,8 @@ class InstanceActivityTestCase(TestCase):
...
@@ -390,8 +391,8 @@ 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
()),
insts
=
[
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
()
,
name
=
"1"
),
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
())]
MagicMock
(
spec
=
Instance
,
migrate
=
MagicMock
()
,
name
=
"2"
)]
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