def test_get_calories_ww_defined_food(session):
with vcr.use_cassette("{}/{}.yaml".format(CASSETTES_HOME, 'egg_log.yaml')):
# This object is actually quite more complicated. But I don't care
food_log = {'portionId': '563c6669305d6e1834ab948d', 'sourceId': 58783, '_displayName': 'Egg(s)',
'sourcePortionName': 'serving(s)', 'points': 4, 'isCore': True, 'name': 'Egg(s)',
'entryId': 'ee1e26a0-4e37-11e6-8aa7-21442c64eff3', 'smartPointsPrecise': 2.0201, 'timeOfDay': 'morning',
'sourcePortionId': 9, 'versionId': '563c6669305d6e1834ab9485', 'smartPoints': 4, 'portionTypeId': 800,
'isActive': True, 'portionName': 'item(s)', 'portionSize': 2, 'isPowerFood': True, 'trackedDate': '2016-07-20',
'sourceType': WW_FOOD, '_servingDesc': '2 item(s)', '_id': '561dcbbae33175473413d475',
'pointsPrecise': 1.8347}
food_detail = get_food_detail(session, food_log)
result = get_nutrition(food_detail, food_log)
assert result == {
'calories': 144.0,
'sodium': 142.0,
'saturatedFat': 3.12,
'carbs': 0.72,
'sugar': 0.36,
'fat': 9.5,
'protein': 12.56
}
test_weight_watchers.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录