Skip to content
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

Adds the whoami/me command #9

Merged
merged 2 commits into from
Feb 5, 2025
Merged

Adds the whoami/me command #9

merged 2 commits into from
Feb 5, 2025

Conversation

chrisguidry
Copy link
Contributor

@chrisguidry chrisguidry commented Feb 5, 2025

This also backfills the test suite for the whole auth module, to
100% coverage.

$ prefect-cloud whoami
                         User                         
┌─────────┬──────────────────────────────────────────┐
│ Name    │ Chris Guidry                             │
│ Email   │ [email protected]                       │
│ Handle  │ chrisgprefectio                          │
│ ID      │ 2ee633f5-a8a1-4367-bd09-cbc329b1622a     │
│ API Key │ pnu_********************************XEHJ │
└─────────┴──────────────────────────────────────────┘

                                               Accounts and Workspaces                                                
┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Account                 ┃ Handle                                            ┃ ID                                   ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ chrisgprefectio         │ chrisgprefectio                                   │ b9b0sfasfdd-1d72-4200-b329-d4332814dc74 │
└─────────────────────────┴───────────────────────────────────────────────────┴──────────────────────────────────────┘

$ pytest --cov --cov-report term-missing
=================================================================== test session starts ====================================================================
platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: /home/chris/src/github.com/PrefectHQ/prefect-cloud
configfile: pyproject.toml
testpaths: tests
plugins: cov-6.0.0, respx-0.22.0, anyio-4.8.0, asyncio-0.25.3, time-machine-2.16.0, xdist-3.6.1
asyncio: mode=Mode.AUTO, asyncio_default_fixture_loop_scope=session
collected 55 items                                                                                                                                         

tests/test_auth.py .........................                                                                                                         [ 45%]
tests/test_auth_interactive.py .....                                                                                                                 [ 54%]
tests/test_auth_profiles.py ........................                                                                                                 [ 98%]
tests/test_the_tests.py .                                                                                                                            [100%]

---------- coverage: platform linux, python 3.12.8-final-0 -----------
Name                                      Stmts   Miss  Cover   Missing
-----------------------------------------------------------------------
src/prefect_cloud/__init__.py                 0      0   100%
src/prefect_cloud/auth.py                   209      0   100%
src/prefect_cloud/utilities/__init__.py       0      0   100%
src/prefect_cloud/utilities/tui.py           42     35    17%   10-12, 29-80
tests/__init__.py                             0      0   100%
tests/conftest.py                            15      0   100%
tests/test_auth.py                          130      0   100%
tests/test_auth_interactive.py               56      0   100%
tests/test_auth_profiles.py                 120      0   100%
tests/test_the_tests.py                       2      0   100%
-----------------------------------------------------------------------
TOTAL                                       574     35    94%


==================================================================== 55 passed in 1.03s ====================================================================

Part of ENG-1067

This also backfills the test suite for the whole `auth` module, to
100% coverage.

Part of ENG-1067
@@ -0,0 +1,20 @@
This is the test suite for the `prefect-cloud` command library.
Copy link
Collaborator

@jakekaplan jakekaplan Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably need a .gitignore for this unless it was intentional?

Copy link
Contributor Author

@chrisguidry chrisguidry Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This is where we'd tell the LLMs our coding style, which I think we'd want to share across devs on the project?

Copy link
Collaborator

@jakekaplan jakekaplan Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me! just wasn't sure

@chrisguidry chrisguidry merged commit bd13723 into main Feb 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants