async def test_item_id_search() -> None: client = Client() found = False async for item in client.search(item_ids=[TEST_ITEM.id]): if item.name == TEST_ITEM.name and item.id == TEST_ITEM.id: found = True assert found
async def test_query_search() -> None: client = Client() found = False async for item in client.search(query=TEST_ITEM.name): if item.name == TEST_ITEM.name and item.id == TEST_ITEM.id: found = True assert found
async def test_wearable_search() -> None: client = Client() found = False async for item in client.search(query=TEST_ITEM.name, species_id=TEST_PET.species, color_id=TEST_PET.color): if item.name == TEST_ITEM.name and item.id == TEST_ITEM.id: found = True assert found
async def test_query_exact_search_multiple() -> None: client = Client() result_ids = [] async for item in client.search( item_names=[TEST_ITEM.name, TEST_ITEM_TWO.name]): result_ids.append(item.id) found = TEST_ITEM.id in result_ids and TEST_ITEM_TWO.id in result_ids assert found
async def test_statefulness() -> None: client = Client() found = False async for item in client.search(query=TEST_ITEM.name): if item.name == TEST_ITEM.name and item.id == TEST_ITEM.id: found = True pet = await client.fetch_neopet(color=TEST_PET.color, species=TEST_PET.species) assert found and pet
async def test_item_id_search_broken() -> None: client = Client() with pytest.raises(InvalidItemID): async for item in client.search(item_ids=[1]): print(item)
async def main(): dti_client = Client() async for item in dti_client.search(item_ids=[81162]): print(item)