Force the client_id to exist in the results from ProfileFetcher.

This commit is contained in:
Victor Ng 2018-02-28 11:49:04 -05:00
Родитель b5f0d6282c
Коммит 1fc30c0f91
2 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -22,6 +22,7 @@ class ProfileFetcher(object):
if not addon.get('is_system', False)] if not addon.get('is_system', False)]
return { return {
"client_id": client_id,
"geo_city": profile_data.get("city", ''), "geo_city": profile_data.get("city", ''),
"subsession_length": profile_data.get("subsession_length", 0), "subsession_length": profile_data.get("subsession_length", 0),
"locale": profile_data.get('locale', ''), "locale": profile_data.get('locale', ''),

Просмотреть файл

@ -28,6 +28,7 @@ def test_profile_fetcher_returns_dict():
# Note that active_addons in the raw JSON source is remapped to # Note that active_addons in the raw JSON source is remapped to
# 'installed_addons' # 'installed_addons'
assert fetcher.get("random-client-id") == { assert fetcher.get("random-client-id") == {
"client_id": 'random-client-id',
"bookmark_count": 0, "bookmark_count": 0,
"disabled_addons_ids": [], "disabled_addons_ids": [],
"geo_city": "Rome", "geo_city": "Rome",