Merge pull request #44121 from benediktwerner/2017.7

Fixed code snippet in unit testing documentation
This commit is contained in:
Nicole Thomas 2017-10-16 14:28:36 -04:00 committed by GitHub
commit 888e5f51a2

View File

@ -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__!