Skip to content

Commit

Permalink
add test for attribute type filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ojii committed Jan 9, 2024
1 parent 468e887 commit 6d4637d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/integration/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
TimeToLiveStatus,
)
from aiodynamo.operations import ConditionCheck, Delete, Get, Put, Update
from aiodynamo.types import TableName
from aiodynamo.types import AttributeType, TableName
from tests.integration.conftest import TableFactory


Expand Down Expand Up @@ -803,3 +803,15 @@ async def test_pay_per_request_table(
assert not set(map(itemgetter("r"), first_page.items)) & set(
map(itemgetter("r"), second_page.items)
)


async def test_attribute_type_filter(client: Client, table: TableName) -> None:
await client.put_item(table=table, item={"h": "h", "r": "1", "a": 1})
await client.put_item(table=table, item={"h": "h", "r": "2", "a": "2"})
items = {
item["r"]
async for item in client.scan(
table=table, filter_expression=F("a").attribute_type(AttributeType.string)
)
}
assert items == {"2"}

0 comments on commit 6d4637d

Please sign in to comment.