Commit 5a418c4
cocalc-api/test: fix edge cases in api and improve testing
This commit updates the conftest.py test fixtures to properly support both
account-scoped and project-scoped API keys during testing.
The validate_api_key_config fixture now:
- First attempts to detect scope via hub.system.test() (account-scoped keys)
- Falls back to project.system.test() if hub fails (project-scoped keys)
- Reports both errors if both endpoints fail, for better debugging
Also clarifies that the hub endpoint's system.test() is for account-scoped
keys only, with clear comments directing project-scoped key users to the
project endpoint.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent ab4ab26 commit 5a418c4
File tree
2 files changed
+24
-4
lines changed- src
- packages/server/conat/api
- python/cocalc-api/tests
2 files changed
+24
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
24 | 22 | | |
25 | 23 | | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
129 | 133 | | |
130 | 134 | | |
131 | 135 | | |
132 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
133 | 153 | | |
134 | 154 | | |
135 | 155 | | |
| |||
0 commit comments