B I?_@sBddlZddlmZmZddlmZddlZGdddejZdS)N)patchMock)utilsc@s8eZdZdZedddddZedddddZd S) TestLogHelperz.https://test_url/this/is/the/url?query=123#aaazcrhelper.utils.HTTPSConnectionT)ZautospeccCs8t|ji|d|jjjddddddddS) Ntest_urlz{}2)z content-typezcontent-lengthPUTz/this/is/the/url?query=123#aaa)bodyheadersmethodurl)r_send_responseTEST_URLassert_called_once_with return_valuerequest)selfhttps_connection_mockrj/private/var/folders/fw/jsxvvqfs4sz4tdnfdvg5typ5vk77qg/T/pip-install-3ph1uos5/crhelper/tests/test_utils.pytest_send_succeeded_response s z*TestLogHelper.test_send_succeeded_responsecCsjt|jt|dt|jjj dd}d|dd}|jjj|dt t |dd d d dS) Nrr z,{"Status": "FAILED", "Data": {}, "Reason": "ZReasonz"}r)z content-typezcontent-lengthr z/this/is/the/url?query=123#aaa)r r r r ) rrrrrjsonloadsrr call_argsstrlen)rrresponseZ expected_bodyrrrtest_send_failed_responses z'TestLogHelper.test_send_failed_responseN)__name__ __module__ __qualname__rrrrrrrrrs r) rZ unittest.mockrrZcrhelperrZunittestZTestCaserrrrrs