Skip to content

Commit

Permalink
feat(storage): changes in unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
HemangChothani committed Aug 5, 2020
1 parent 43f1f5a commit 0bd9bf4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/unit/test_blob.py
Expand Up @@ -4172,11 +4172,17 @@ def test_custom_time_setter(self):
self.assertEqual(blob.custom_time, TIMESTAMP)

def test_custom_time_setter_none_value(self):
from google.cloud._helpers import _RFC3339_MICROS
from google.cloud._helpers import UTC

BLOB_NAME = "blob-name"
bucket = _Bucket()
TIMESTAMP = None
blob = self._make_one(BLOB_NAME, bucket=bucket)
blob.custom_time = TIMESTAMP
TIMESTAMP = datetime.datetime(2014, 11, 5, 20, 34, 37, tzinfo=UTC)
TIME_CREATED = TIMESTAMP.strftime(_RFC3339_MICROS)
properties = {"customTime": TIME_CREATED}
blob = self._make_one(BLOB_NAME, bucket=bucket, properties=properties)
self.assertEqual(blob.custom_time, TIMESTAMP)
blob.custom_time = None
self.assertIsNone(blob.custom_time)

def test_custom_time_unset(self):
Expand Down

0 comments on commit 0bd9bf4

Please sign in to comment.