@@ -15,7 +15,7 @@ def test_should_create_metrics_file_and_store_distinct_id_for_new_user(self) ->
1515 metrics_file = config_dir / "metrics.json"
1616 user_identity_manager = UserIdentityManager (config_dir = config_dir )
1717
18- distinct_id = user_identity_manager .get_distinct_id ()
18+ distinct_id = user_identity_manager .get_or_create_distinct_id ()
1919
2020 expect (metrics_file .exists ()).to (be_true )
2121 stored_distinct_id = json .loads (metrics_file .read_text ())
@@ -27,8 +27,8 @@ def test_should_return_same_id_on_consecutive_calls(self) -> None:
2727 config_dir = Path (temp_dir )
2828 user_identity_manager = UserIdentityManager (config_dir = config_dir )
2929
30- first_id = user_identity_manager .get_distinct_id ()
31- second_id = user_identity_manager .get_distinct_id ()
30+ first_id = user_identity_manager .get_or_create_distinct_id ()
31+ second_id = user_identity_manager .get_or_create_distinct_id ()
3232
3333 expect (first_id ).to (equal (second_id ))
3434
@@ -39,7 +39,7 @@ def test_should_regenerate_id_when_metrics_file_is_invalid(self) -> None:
3939 metrics_file .write_text ("invalid json content" )
4040
4141 user_identity_manager = UserIdentityManager (config_dir = config_dir )
42- distinct_id = user_identity_manager .get_distinct_id ()
42+ distinct_id = user_identity_manager .get_or_create_distinct_id ()
4343
4444 stored_data = json .loads (metrics_file .read_text ())
4545 expect (stored_data ["distinct_id" ]).to (equal (distinct_id ))
@@ -52,7 +52,7 @@ def test_should_load_and_validate_existing_uuid_from_metrics_file(self) -> None:
5252 metrics_file .write_text (json .dumps ({"distinct_id" : existing_uuid }))
5353
5454 user_identity_manager = UserIdentityManager (config_dir = config_dir )
55- distinct_id = user_identity_manager .get_distinct_id ()
55+ distinct_id = user_identity_manager .get_or_create_distinct_id ()
5656
5757 expect (distinct_id ).to (equal (existing_uuid ))
5858 expect (uuid .UUID (distinct_id )).to (be_a (uuid .UUID ))
@@ -64,7 +64,7 @@ def test_should_regenerate_id_when_stored_value_is_not_a_valid_uuid(self) -> Non
6464 metrics_file .write_text (json .dumps ({"distinct_id" : "not-a-valid-uuid" }))
6565
6666 user_identity_manager = UserIdentityManager (config_dir = config_dir )
67- distinct_id = user_identity_manager .get_distinct_id ()
67+ distinct_id = user_identity_manager .get_or_create_distinct_id ()
6868
6969 expect (distinct_id ).not_to (equal ("not-a-valid-uuid" ))
7070 stored_data = json .loads (metrics_file .read_text ())
0 commit comments