-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔑 Add authenticated property to context #917
Conversation
…le to the client.
If we set this attribute inside In [1]: from tiled.client import from_profile
In [2]: client = from_profile('demo')
In [3]: 'authenticated' in dir(client.context)
Out[3]: False
In [4]: client.context # Displaying the object calls `__repr__()` internally.
Out[4]: <Context (unauthenticated)>
In [5]: 'authenticated' in dir(client.context)
Out[5]: True In #818 I suggested "exposing it as a property", i.e. class Context:
...
@property
def authenticated(self):
return ... Thus, |
In this test, we check whether the repr shows the Context being authenticated or not. This would be a good place to test the new tiled/tiled/_tests/test_authentication.py Lines 66 to 94 in 48bb130
And here for the API key case: tiled/tiled/_tests/test_authentication.py Lines 342 to 358 in 48bb130
|
Co-authored-by: Dan Allan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and looks good!
Resolves #818
Checklist
authenticated
property returnTrue
orFalse
depending on the state of the clientauthenticated
property show up in the tab context menu of ipython or in the output ofdir(c.context)
Optional
authenticated
property