本文整理匯總了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)