Skip to content

Commit d43dde1

Browse files
committed
chore: format
1 parent dc667ae commit d43dde1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/firebase_functions/private/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def timestamp_conversion(time) -> _dt.datetime:
409409
"""
410410
# Handle Firebase Timestamp object case
411411
# Accept dict-like objects, or python objects with 'seconds' and 'nanoseconds' attributes
412-
if hasattr(time, 'seconds') and hasattr(time, 'nanoseconds'):
412+
if hasattr(time, "seconds") and hasattr(time, "nanoseconds"):
413413
# Use UTC time
414414
return _dt.datetime.fromtimestamp(
415415
time.seconds + time.nanoseconds / 1_000_000_000, tz=_dt.timezone.utc

tests/test_util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def test_timestamp_conversion_with_object():
196196
"""
197197
Testing timestamp_conversion works with objects that have seconds and nanoseconds attributes.
198198
"""
199+
199200
class Timestamp:
200201
def __init__(self, seconds, nanoseconds):
201202
self.seconds = seconds
@@ -256,6 +257,7 @@ def test_timestamp_conversion_errors():
256257
"""
257258
Testing timestamp_conversion raises appropriate errors for invalid inputs.
258259
"""
260+
259261
class IncompleteTimestamp:
260262
def __init__(self, nanoseconds):
261263
self.nanoseconds = nanoseconds
@@ -274,4 +276,3 @@ def __init__(self, nanoseconds):
274276

275277
with pytest.raises(ValueError):
276278
timestamp_conversion(None)
277-

0 commit comments

Comments
 (0)