minitor/tests/util.py
Ian Fijolek 4683b3856e
Some checks failed
continuous-integration/drone/push Build is failing
Allow building against more Python versions
2019-07-30 21:17:24 -07:00

13 lines
341 B
Python

from unittest import mock
def assert_called_once(mocked):
"""Safe convenient methods for mock asserts"""
assert mocked.call_count == 1
def assert_called_once_with(mocked, *args, **kwargs):
"""Safe convenient methods for mock asserts"""
assert_called_once(mocked)
assert mocked.call_args == mock.call(*args, **kwargs)