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
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,4 @@ transaction.commit()
* [William Li](https://github.com/wli)
* [Ugo Marchand](https://github.com/UgoM)
* [Bryce Thornton](https://github.com/brycethornton)

5 changes: 4 additions & 1 deletion mockfirestore/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def __init__(self, data: Store, path: List[str],
self._data = data
self._path = path
self.parent = parent
self.id = None
if len(path):
self.id = path[0]

def document(self, document_id: Optional[str] = None) -> DocumentReference:
collection = get_by_path(self._data, self._path)
Expand Down Expand Up @@ -80,6 +83,6 @@ def list_documents(self, page_size: Optional[int] = None) -> Sequence[DocumentRe
return docs

def stream(self, transaction=None) -> Iterable[DocumentSnapshot]:
for key in sorted(get_by_path(self._data, self._path)):
for key in sorted({str(k):v for k,v in get_by_path(self._data, self._path).items()}):
doc_snapshot = self.document(key).get()
yield doc_snapshot