TimestreamWrite: Add docs on how to check records using the internal API (#5772)

This commit is contained in:
Bert Blommers 2022-12-14 23:09:00 -01:00 committed by GitHub
parent a4146f0179
commit c5094cca3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -12,6 +12,8 @@
timestream-write
================
.. autoclass:: moto.timestreamwrite.models.TimestreamWriteBackend
|start-h3| Example usage |end-h3|
.. sourcecode:: python

View File

@ -104,6 +104,19 @@ class TimestreamDatabase(BaseModel):
class TimestreamWriteBackend(BaseBackend):
"""
When using the decorators, you can use the following internal API to verify records have arrived:
.. sourcecode:: python
from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
from moto.timestreamwrite.models import timestreamwrite_backends
backend = timestreamwrite_backends[ACCOUNT_ID]["us-east-1"]
records = backend.databases["mydatabase"].tables["mytable"].records
"""
def __init__(self, region_name, account_id):
super().__init__(region_name, account_id)
self.databases = dict()