test: remove mixpanel assertions from analytics tests

This commit is contained in:
Paul Gauthier 2024-12-04 11:58:35 -08:00 committed by Paul Gauthier (aider)
parent 0e2c0c78f2
commit 14143243b1

View file

@ -37,7 +37,7 @@ def test_analytics_enable_disable(temp_data_dir):
analytics.asked_opt_in = True
analytics.enable()
assert analytics.mp is not None
# assert analytics.mp is not None
assert analytics.ph is not None
analytics.disable(permanently=False)
@ -65,17 +65,18 @@ def test_analytics_event_logging(temp_analytics_file, temp_data_dir):
test_event = "test_event"
test_properties = {"test_key": "test_value"}
# with patch.object(analytics.mp, "track") as mock_mp_track:
with patch.object(analytics.ph, "capture") as mock_ph_capture:
analytics.event(test_event, **test_properties)
mock_mp_track.assert_called_once()
# mock_mp_track.assert_called_once()
mock_ph_capture.assert_called_once()
# Verify logfile
with open(temp_analytics_file) as f:
log_entry = json.loads(f.read().strip())
assert log_entry["event"] == test_event
assert "test_key" in log_entry["properties"]
# Verify logfile
with open(temp_analytics_file) as f:
log_entry = json.loads(f.read().strip())
assert log_entry["event"] == test_event
assert "test_key" in log_entry["properties"]
def test_system_info(temp_data_dir):