()
| 6 | @pytest.mark.asyncio |
| 7 | @pytest.mark.flaky(reruns=1, reruns_delay=2) |
| 8 | async def test_inherit_client(): |
| 9 | class SubClient(rnet.Client): |
| 10 | def __init__(self, **kwargs): |
| 11 | self.test_var = "test" |
| 12 | self.cookie_jar = None |
| 13 | |
| 14 | client = SubClient(impersonate=Impersonate.Chrome133) |
| 15 | url = "https://google.com" |
| 16 | response = await client.get(url) |
| 17 | text = await response.text() |
| 18 | assert text is not None |
| 19 | assert client.cookie_jar is None |
| 20 | assert client.test_var == "test" |
| 21 | client.update( |
| 22 | impersonate=ImpersonateOption( |
| 23 | impersonate=Impersonate.Firefox135, |
| 24 | impersonate_os=ImpersonateOS.Windows, |
| 25 | skip_headers=False, |
| 26 | ) |
| 27 | ) |
| 28 | assert ( |
| 29 | client.user_agent |
| 30 | == "Mozilla/5.0 (Windows NT 10.0; rv:135.0) Gecko/20100101 Firefox/135.0" |
| 31 | ) |
| 32 | assert client.test_var == "test" |
| 33 | |
| 34 | |
| 35 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected