本文整理汇总了Python中pyuploadcare.api_resources.FileGroup.datetime_stored方法的典型用法代码示例。如果您正苦于以下问题:Python FileGroup.datetime_stored方法的具体用法?Python FileGroup.datetime_stored怎么用?Python FileGroup.datetime_stored使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyuploadcare.api_resources.FileGroup
的用法示例。
在下文中一共展示了FileGroup.datetime_stored方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FileGroupDateMethodsTest
# 需要导入模块: from pyuploadcare.api_resources import FileGroup [as 别名]
# 或者: from pyuploadcare.api_resources.FileGroup import datetime_stored [as 别名]
class FileGroupDateMethodsTest(unittest.TestCase):
def setUp(self):
self.group = FileGroup('0513dda0-582f-447d-846f-096e5df9e2bb~2')
def test_datetime_stored_is_none(self):
self.group._info_cache = {'datetime_stored': ''}
self.assertIsNone(self.group.datetime_stored())
def test_datetime_stored_is_utc(self):
self.group._info_cache = {'datetime_stored': '2013-04-03T12:01:28.714Z'}
expected_datetime = datetime.datetime(
year=2013, month=4, day=3, hour=12, minute=1, second=28,
microsecond=714000, tzinfo=tzutc())
self.assertEqual(self.group.datetime_stored(), expected_datetime)
def test_datetime_created_is_none(self):
self.group._info_cache = {'datetime_created': ''}
self.assertIsNone(self.group.datetime_created())
def test_datetime_created_is_utc(self):
self.group._info_cache = {'datetime_created': '2013-04-03T12:01:28.714Z'}
expected_datetime = datetime.datetime(
year=2013, month=4, day=3, hour=12, minute=1, second=28,
microsecond=714000, tzinfo=tzutc())
self.assertEqual(self.group.datetime_created(), expected_datetime)