def test_dataset_stats_counter_empty():
counter = DatasetStatsCounter(quarter='2013Q1', dataset_id='VA')
with moto.mock_s3():
with freeze_time('2017-01-10'):
s3_conn = boto.connect_s3()
s3_conn.create_bucket('test-bucket')
counter.save(s3_conn, 'test-bucket/stats')
key = s3_conn.get_bucket('test-bucket')\
.get_key('stats/quarterly/VA_2013Q1')
expected_stats = {
'total': 0,
'output_counts': {},
'input_counts': {},
'output_percentages': {},
'input_percentages': {},
'last_updated': '2017-01-10T00:00:00',
'quarter': '2013Q1',
}
assert json.loads(key.get_contents_as_string().decode('utf-8')) == expected_stats
test_transform_dataset_stats.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录