Coverage for polar/checkout/guard.py: 50%

12 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-12-05 16:17 +0000

1from typing import TYPE_CHECKING, TypeIs 1a

2from uuid import UUID 1a

3 

4from polar.models import Checkout, Product, ProductPrice 1a

5 

6if TYPE_CHECKING: 6 ↛ 8line 6 didn't jump to line 8 because the condition on line 6 was never true1a

7 

8 class ProductCheckout(Checkout): 

9 product_id: UUID 

10 product: Product 

11 product_price_id: UUID 

12 product_price: ProductPrice 

13else: 

14 ProductCheckout = Checkout 1a

15 

16 

17def has_product_checkout(checkout: Checkout) -> TypeIs[ProductCheckout]: 1a

18 return checkout.product is not None and checkout.product_price is not None