Coverage for src/zapy/api/v1/api_store.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.4.1, created at 2024-02-10 19:35 +0000

1import magicattr 

2from fastapi import APIRouter 

3 

4from zapy.store.attr import Attr, build_attr_info 

5from zapy.store.context import Stores 

6 

7api_store_v1 = APIRouter(tags=["v1"]) 

8 

9 

10@api_store_v1.get("/stores/{store_id}") 

11async def get_store(store_id: str) -> Attr: 

12 stores = Stores() 

13 attr = magicattr.get(stores, store_id) 

14 return build_attr_info(attr, store_id)