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
13d0b9a9
authored
Apr 01, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: more tests for operations
parent
d68c66a0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
circle/vm/tests/test_operations.py
+22
-0
No files found.
circle/vm/tests/test_operations.py
View file @
13d0b9a9
...
...
@@ -42,6 +42,28 @@ class OperationTestCase(TestCase):
except
AbortEx
:
self
.
assertTrue
(
chk_pre
.
called
)
def
test_auth_check_on_non_system_call
(
self
):
op
=
Operation
(
MagicMock
())
op
.
activity_code_suffix
=
'test'
op
.
id
=
'test'
user
=
MagicMock
()
with
patch
.
object
(
Operation
,
'check_auth'
)
as
check_auth
:
with
patch
.
object
(
Operation
,
'check_precond'
),
\
patch
.
object
(
Operation
,
'create_activity'
),
\
patch
.
object
(
Operation
,
'_exec_op'
):
op
.
call
(
user
=
user
)
check_auth
.
assert_called_with
(
user
)
def
test_no_auth_check_on_system_call
(
self
):
op
=
Operation
(
MagicMock
())
op
.
activity_code_suffix
=
'test'
op
.
id
=
'test'
with
patch
.
object
(
Operation
,
'check_auth'
,
side_effect
=
AssertionError
):
with
patch
.
object
(
Operation
,
'check_precond'
),
\
patch
.
object
(
Operation
,
'create_activity'
),
\
patch
.
object
(
Operation
,
'_exec_op'
):
op
.
call
(
system
=
True
)
class
DeployOperationTestCase
(
TestCase
):
def
test_operation_registered
(
self
):
...
...
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