added a noop fixture loader module for tests

This commit is contained in:
Victor Ng 2020-09-01 11:40:16 -04:00
Родитель 77eef1db83
Коммит 1c0d686f32
1 изменённых файлов: 41 добавлений и 0 удалений

41
tests/noop_fixtures.py Normal file
Просмотреть файл

@ -0,0 +1,41 @@
"""
Noop helpers
"""
import mock
from taar.recommenders.redis_cache import AddonsCoinstallCache
def noop_taarlite_dataload(stack):
# no-op the taarlite rankdata
stack.enter_context(
mock.patch.object(AddonsCoinstallCache, "_update_rank_data", return_value=None)
)
# no-op the taarlite guidguid data
stack.enter_context(
mock.patch.object(
AddonsCoinstallCache, "_update_coinstall_data", return_value=None,
)
)
return stack
def noop_taarlocale_dataload(stack):
# no-op the taarlite rankdata
stack.enter_context(
mock.patch.object(
AddonsCoinstallCache, "_update_locale_data", return_value=None
)
)
return stack
def noop_taarcollab_dataload(stack):
# no-op the taar collab
stack.enter_context(
mock.patch.object(
AddonsCoinstallCache, "_update_collab_data", return_value=None
)
)
return stack