test_taar_locale.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:python_mozetl 作者: mozilla 项目源码 文件源码
def test_generate_dictionary(spark, multi_locales_df):
    conn = boto3.resource('s3', region_name='us-west-2')
    conn.create_bucket(Bucket=taar_utils.AMO_DUMP_BUCKET)

    # Store the data in the mocked bucket.
    conn.Object(taar_utils.AMO_DUMP_BUCKET, key=taar_utils.AMO_DUMP_KEY)\
        .put(Body=json.dumps(FAKE_AMO_DUMP))

    multi_locales_df.createOrReplaceTempView("longitudinal")

    # The "en-US" locale must not be reported: we set it to a low
    # frequency on |multi_locale_df|.
    expected = {
        "it-IT": ["test-guid-0001"]
    }

    assert taar_locale.generate_dictionary(spark, 5) == expected
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号