Last active
July 30, 2020 14:10
-
-
Save Luttik/b2edee0645c318f6ef60c154725d1400 to your computer and use it in GitHub Desktop.
An example locker call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @patch.object(XyzAPI, "XyzCall") | |
| def test_contact_routing(mock: MagicMock, locker: Locker): | |
| do_logic_that_calls_xyz() | |
| # Uses json to serialize response | |
| # call_args_list contains the data for all calls that XyzApi.XyzCall got | |
| # indent=2 for readibility | |
| # sort_keys=True for deterministic serialization of dictionaries. | |
| locker.lock(json.dumps(mock.call_args_list, indent=2, sort_keys=True)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment