Example #1
0
async def test_user_too_slow(github_device_api: GitHubDeviceAPI):
    github_device_api._expires = datetime.timestamp(datetime.now()) - 1
    with pytest.raises(GitHubException,
                       match="User took too long to enter key"):
        await github_device_api.activation(device_code=DEVICE_CODE)
Example #2
0
async def test_missing_expiration(github_device_api: GitHubDeviceAPI):
    github_device_api._expires = None
    with pytest.raises(GitHubException,
                       match="Expiration has passed, re-run the registration"):
        await github_device_api.activation(device_code=DEVICE_CODE)