Пример #1
0
def test_can_recommend_no_model(mock_s3_json_downloader):
    r = LocaleRecommender()

    # We should never be able to recommend if something went
    # wrong with the model.
    assert not r.can_recommend({})
    assert not r.can_recommend({"locale": []})
    assert not r.can_recommend({"locale": "it"})
Пример #2
0
def test_can_recommend_no_model(test_ctx):
    ctx = install_mock_data(test_ctx)
    r = LocaleRecommender(ctx)

    # We should never be able to recommend if something went
    # wrong with the model.
    assert not r.can_recommend({})
    assert not r.can_recommend({"locale": []})
    assert not r.can_recommend({"locale": "it"})
Пример #3
0
def test_can_recommend(mock_s3_json_downloader):
    r = LocaleRecommender()

    # Test that we can't recommend if we have not enough client info.
    assert not r.can_recommend({})
    assert not r.can_recommend({"locale": []})

    # Check that we can recommend if the user has at least an addon.
    assert r.can_recommend({"locale": "en"})
Пример #4
0
def test_can_recommend_no_model():
    ctx = create_test_ctx()
    r = LocaleRecommender(ctx)

    # We should never be able to recommend if something went
    # wrong with the model.
    assert not r.can_recommend({})
    assert not r.can_recommend({"locale": []})
    assert not r.can_recommend({"locale": "it"})
Пример #5
0
def test_can_recommend(test_ctx):
    ctx = install_mock_data(test_ctx)
    r = LocaleRecommender(ctx)

    # Test that we can't recommend if we have not enough client info.
    assert not r.can_recommend({})
    assert not r.can_recommend({"locale": []})

    # Check that we can recommend if the user has at least an addon.
    assert r.can_recommend({"locale": "en"})