python-mock-firestore
python-mock-firestore copied to clipboard
In-memory implementation of Google Cloud Firestore for use in tests
There following methods were not yet implemented, I did my best to add them to help pass my unit tests. - [Client.recursive_delete()](https://googleapis.dev/python/firestore/latest/client.html#google.cloud.firestore_v1.client.Client.recursive_delete) - [DocumentReference.collections() ](https://googleapis.dev/python/firestore/latest/document.html#google.cloud.firestore_v1.document.DocumentReference.collections)
- Closes #55 by adding: - `AsyncClient` - `AsyncDocumentReference` - `AsyncCollectionReference` - `AsyncQuery` - `AsyncTransaction` - Removes deprecation warnings from `Collection.get` and other equivalent methods, since they are apparently no...
This pull request addressing #52 which I opened I was not sure what formatting rules are being used on this repo. I have black and isort set in my editor...
As [black](https://github.com/psf/black) is becoming the de-facto standard formatter for Python code, I think we should use it in this repository. The formatting is wonky in multiple places, and using black...
According to [the documentation](https://firebase.google.com/docs/firestore/manage-data/add-data#update_elements_in_an_array) `ArrayUnion` should only add elements that aren't already present in the array. E.g. this test should succeed: ```py def test_document_update_transformerArrayUnionDuplicates(self): fs = MockFirestore() fs._data = {"foo":...
The current implementation works pretty well, but it has one flaw. It throws a `KeyError` when the document itself does not exist, but a subcollection does. According to the actual...
Firstly, thank you for your work on this library. I have a project that deals with firestore a lot and being able to mock it in tests is super easy...
From the line arr = self.mock_db.collection('players').stream() I expected a return type of `Iterable[DocumentSnapshot]` but instead got ### My setup code: def setUp(self) -> None: self.mock_db = MockFirestore() self.mock_db.collection('players').add({ 'name': 'John...