Coverage for youversion/clients/async_client.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.14.3, created at 2026-06-26 11:31 +0100

1"""Asynchronous client for YouVersion Bible API.""" 

2 

3from ..core.base_client import BaseClient 

4 

5 

6class AsyncClient(BaseClient): 

7 """Asynchronous client for YouVersion Bible API.""" 

8 

9 def __init__(self, username: str | None = None, password: str | None = None): 

10 """Initialize async client. 

11 

12 Args: 

13 username: Username for authentication 

14 password: Password for authentication 

15 """ 

16 super().__init__(username, password) 

17 

18 async def __aenter__(self): 

19 """Async context manager entry.""" 

20 await self._ensure_authenticated() 

21 return self 

22 

23 async def __aexit__(self, exc_type, exc_val, exc_tb): 

24 """Async context manager exit.""" 

25 await self.close()