зеркало из https://github.com/mozilla/taar.git
added a noop fixture loader module for tests
This commit is contained in:
Родитель
77eef1db83
Коммит
1c0d686f32
|
@ -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
|
Загрузка…
Ссылка в новой задаче