Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
neoppod
Commits
e5c056b9
Commit
e5c056b9
authored
Jan 21, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: document Patch class
parent
d43bd510
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
neo/tests/__init__.py
neo/tests/__init__.py
+22
-0
No files found.
neo/tests/__init__.py
View file @
e5c056b9
...
...
@@ -519,6 +519,28 @@ class NeoUnitTestBase(NeoTestBase):
class
Patch
(
object
):
"""
Patch attributes and revert later automatically.
Usage:
with Patch(someObject, attrToPatch=newValue, [otherAttr=...]) as patch:
[... code that runs with patches ...]
[... code that runs without patch ...]
' as patch' is optional: 'patch.revert()' can be used to revert patches
in the middle of the 'with' clause.
Or:
patch = Patch(...)
patch.apply()
In this case, patches are automatically reverted when 'patch' is deleted.
For patched callables, the new one receives the original value as first
argument.
"""
applied
=
False
...
...
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