From 1fc30c0f919e9521f2b5bfc3eed248c644608e95 Mon Sep 17 00:00:00 2001 From: Victor Ng Date: Wed, 28 Feb 2018 11:49:04 -0500 Subject: [PATCH] Force the client_id to exist in the results from ProfileFetcher. --- taar/profile_fetcher.py | 1 + tests/test_profile_fetcher.py | 1 + 2 files changed, 2 insertions(+) diff --git a/taar/profile_fetcher.py b/taar/profile_fetcher.py index 3af0225..a2f5926 100644 --- a/taar/profile_fetcher.py +++ b/taar/profile_fetcher.py @@ -22,6 +22,7 @@ class ProfileFetcher(object): if not addon.get('is_system', False)] return { + "client_id": client_id, "geo_city": profile_data.get("city", ''), "subsession_length": profile_data.get("subsession_length", 0), "locale": profile_data.get('locale', ''), diff --git a/tests/test_profile_fetcher.py b/tests/test_profile_fetcher.py index a843b33..556ae2a 100644 --- a/tests/test_profile_fetcher.py +++ b/tests/test_profile_fetcher.py @@ -28,6 +28,7 @@ def test_profile_fetcher_returns_dict(): # Note that active_addons in the raw JSON source is remapped to # 'installed_addons' assert fetcher.get("random-client-id") == { + "client_id": 'random-client-id', "bookmark_count": 0, "disabled_addons_ids": [], "geo_city": "Rome",