mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 12:55:00 +00:00
test: remove mixpanel assertions from analytics tests
This commit is contained in:
parent
0e2c0c78f2
commit
14143243b1
1 changed files with 8 additions and 7 deletions
|
@ -37,7 +37,7 @@ def test_analytics_enable_disable(temp_data_dir):
|
||||||
analytics.asked_opt_in = True
|
analytics.asked_opt_in = True
|
||||||
|
|
||||||
analytics.enable()
|
analytics.enable()
|
||||||
assert analytics.mp is not None
|
# assert analytics.mp is not None
|
||||||
assert analytics.ph is not None
|
assert analytics.ph is not None
|
||||||
|
|
||||||
analytics.disable(permanently=False)
|
analytics.disable(permanently=False)
|
||||||
|
@ -65,17 +65,18 @@ def test_analytics_event_logging(temp_analytics_file, temp_data_dir):
|
||||||
test_event = "test_event"
|
test_event = "test_event"
|
||||||
test_properties = {"test_key": "test_value"}
|
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:
|
with patch.object(analytics.ph, "capture") as mock_ph_capture:
|
||||||
analytics.event(test_event, **test_properties)
|
analytics.event(test_event, **test_properties)
|
||||||
|
|
||||||
mock_mp_track.assert_called_once()
|
# mock_mp_track.assert_called_once()
|
||||||
mock_ph_capture.assert_called_once()
|
mock_ph_capture.assert_called_once()
|
||||||
|
|
||||||
# Verify logfile
|
# Verify logfile
|
||||||
with open(temp_analytics_file) as f:
|
with open(temp_analytics_file) as f:
|
||||||
log_entry = json.loads(f.read().strip())
|
log_entry = json.loads(f.read().strip())
|
||||||
assert log_entry["event"] == test_event
|
assert log_entry["event"] == test_event
|
||||||
assert "test_key" in log_entry["properties"]
|
assert "test_key" in log_entry["properties"]
|
||||||
|
|
||||||
|
|
||||||
def test_system_info(temp_data_dir):
|
def test_system_info(temp_data_dir):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue