def test_quarterly_posting_stats():
with moto.mock_s3():
s3_conn = boto.connect_s3()
s3_conn.create_bucket('stats-bucket')
bucket = s3_conn.get_bucket('stats-bucket')
upload_quarterly_dataset_counts(bucket, 'XX', '2014Q1', 5)
upload_quarterly_dataset_counts(bucket, 'XX', '2014Q2', 6)
upload_quarterly_dataset_counts(bucket, 'XX', '2014Q3', 7)
upload_quarterly_dataset_counts(bucket, 'XX', '2014Q4', 8)
upload_quarterly_dataset_counts(bucket, 'ZZ', '2014Q1', 10)
upload_quarterly_dataset_counts(bucket, 'ZZ', '2014Q2', 9)
upload_quarterly_dataset_counts(bucket, 'ZZ', '2014Q3', 8)
upload_quarterly_dataset_counts(bucket, 'ZZ', '2014Q4', 10)
assert DatasetStatsCounter.quarterly_posting_stats(
s3_conn,
config['partner_stats']['s3_path']
) == {
'2014Q1': 15,
'2014Q2': 15,
'2014Q3': 15,
'2014Q4': 18
}
test_transform_dataset_stats.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录