mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #44121 from benediktwerner/2017.7
Fixed code snippet in unit testing documentation
This commit is contained in:
commit
888e5f51a2
@ -123,7 +123,7 @@ to the module being tests one should do:
|
||||
}
|
||||
|
||||
Consider this more extensive example from
|
||||
``tests/unit/modules/test_libcloud_dns.py``::
|
||||
``tests/unit/modules/test_libcloud_dns.py``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@ -319,7 +319,7 @@ function into ``__salt__`` that's actually a MagicMock instance.
|
||||
|
||||
def show_patch(self):
|
||||
with patch.dict(my_module.__salt__,
|
||||
{'function.to_replace': MagicMock()}:
|
||||
{'function.to_replace': MagicMock()}):
|
||||
# From this scope, carry on with testing, with a modified __salt__!
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user