def test_MAU_no_country_list(spark, main_summary_data): main_summary = spark.createDataFrame(*main_summary_data) without_country_list = getMAU(main_summary, '20180201', sample_factor=100.0 / 1) expected = [{ "country": "All", "active_users": 200, "submission_date_s3": "20180201" }] is_same(spark, without_country_list, expected, verbose=True)
def test_MAU_country_list(spark, main_summary_data): main_summary = spark.createDataFrame(*main_summary_data) with_country_list = getMAU(main_summary, '20180201', sample_factor=100.0 / 1, country_list=["DE"]) expected = [{ "country": "All", "MAU": 200, "submission_date_s3": "20180201" }, { "country": "DE", "MAU": 200, "submission_date_s3": "20180201" }] is_same(spark, with_country_list, expected)