from atlas_um.analytics.amplitude import Amplitude class TestAmplitude: def test_send_event(self, mocker, faker): mocked_post = mocker.patch("requests.post") test_api_key = faker.pystr() test_event = faker.pydict() amplitude = Amplitude(api_key=test_api_key) amplitude.send_event(test_event) assert mocked_post.call_args_list == [ mocker.call( "https://api2.amplitude.com/2/httpapi", json={"api_key": test_api_key, "events": [test_event]}, headers={"Content-Type": "application/json", "Accept": "*/*"}, ) ]