Added a basic integration test so that we can see recommenders running

from local development
This commit is contained in:
Victor Ng 2018-02-28 11:44:52 -05:00
Родитель 48c46a1021
Коммит 81849c975c
1 изменённых файлов: 18 добавлений и 0 удалений

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

@ -0,0 +1,18 @@
import pytest
from taar.context import default_context
from taar import ProfileController, ProfileFetcher
from taar import recommenders
@pytest.mark.skip("This is an integration test")
def test_recommenders(client_id='some_dev_client_id', branch='linear'):
root_ctx = default_context()
client = ProfileController('us-west-2', 'taar_addon_data_20180206')
pf = ProfileFetcher(client)
root_ctx['profile_fetcher'] = pf
r_factory = recommenders.RecommenderFactory(root_ctx.child())
root_ctx['recommender_factory'] = r_factory
rm = recommenders.RecommendationManager(root_ctx.child())
result = rm.recommend(client_id, limit=10, extra_data={'branch': branch})
print(result)
return result