Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions mockfirestore/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def read_time(self) -> Timestamp:
timestamp = Timestamp.from_now()
return timestamp

def get(self, field_path: str) -> Any:
def get(self, field_path: str, transaction=None) -> Any:
if not self.exists:
return None
else:
Expand All @@ -63,7 +63,11 @@ def __init__(self, data: Store, path: List[str],
def id(self):
return self._path[-1]

def get(self) -> DocumentSnapshot:
@property
def path(self):
return "/".join(self._path)

def get(self, transaction=None) -> DocumentSnapshot:
return DocumentSnapshot(self, get_by_path(self._data, self._path))

def delete(self):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="mock-firestore",
version="0.11.0",
version="0.11.3",
author="Matt Dowds",
description="In-memory implementation of Google Cloud Firestore for use in tests",
long_description=long_description,
Expand All @@ -21,4 +21,4 @@
'Programming Language :: Python :: 3.10',
"License :: OSI Approved :: MIT License",
],
)
)