本文整理汇总了Python中fitbit.Fitbit.body方法的典型用法代码示例。如果您正苦于以下问题:Python Fitbit.body方法的具体用法?Python Fitbit.body怎么用?Python Fitbit.body使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fitbit.Fitbit
的用法示例。
在下文中一共展示了Fitbit.body方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_body
# 需要导入模块: from fitbit import Fitbit [as 别名]
# 或者: from fitbit.Fitbit import body [as 别名]
def test_body(self):
# Test the first method defined in __init__ to see if it calls
# _COLLECTION_RESOURCE okay - if it does, they should all since
# they're all built the same way
# We need to mock _COLLECTION_RESOURCE before we create the Fitbit object,
# since the __init__ is going to set up references to it
with mock.patch('fitbit.api.Fitbit._COLLECTION_RESOURCE') as coll_resource:
coll_resource.return_value = 999
fb = Fitbit('x', 'y')
retval = fb.body(date=1, user_id=2, data=3)
args, kwargs = coll_resource.call_args
self.assertEqual(('body',), args)
self.assertEqual({'date': 1, 'user_id': 2, 'data': 3}, kwargs)
self.assertEqual(999, retval)