spooling 0.2.18__tar.gz → 0.2.19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {spooling-0.2.18/spooling.egg-info → spooling-0.2.19}/PKG-INFO +32 -1
- {spooling-0.2.18 → spooling-0.2.19}/README.md +31 -0
- {spooling-0.2.18 → spooling-0.2.19}/pyproject.toml +1 -1
- {spooling-0.2.18 → spooling-0.2.19}/spooling/cloud.py +25 -1
- {spooling-0.2.18 → spooling-0.2.19/spooling.egg-info}/PKG-INFO +32 -1
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_cloud_errors.py +23 -1
- {spooling-0.2.18 → spooling-0.2.19}/LICENSE +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/setup.cfg +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/__init__.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/agent.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/classifiers.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/cli.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/config.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/__init__.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/base.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/bigquery.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/clickhouse.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/factory.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/mongodb.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/mysql.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/postgresql.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/rest/__init__.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/rest/base.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/rest/shopify_connectors.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/snowflake.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/connectors/types.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/db.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/device_login.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/embeddings.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/evals.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/experiments.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/ingest.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/insights.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/mcp_server.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/optimize.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/parser.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/pricing.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/__init__.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/antigravity.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/base.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/claude_code.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/codex.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/copilot.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/cortex_code.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/cursor.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/gemini.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/github.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/gitlab.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/kiro.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/opencode.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/session_file.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/providers/windsurf.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/redact.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/remote_otel.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/schema.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/sdk.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/search.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/server.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/sessions.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/stats.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/subscription_pricing.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/summarize.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/tracing.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/tunnel.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/tunnel_auth.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling/watcher.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling.egg-info/SOURCES.txt +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling.egg-info/dependency_links.txt +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling.egg-info/entry_points.txt +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling.egg-info/requires.txt +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/spooling.egg-info/top_level.txt +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_agent_spans.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_claude_code_provider.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_cloud_teams.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_device_login.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_docs.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_insights.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_mcp_auth_middleware.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_session_ids.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_storage_optimizations.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_summarize.py +0 -0
- {spooling-0.2.18 → spooling-0.2.19}/tests/test_tunnel_auth.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spooling
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.19
|
|
4
4
|
Summary: Local session tracker and semantic search for AI coding assistants
|
|
5
5
|
Author: Parsed Analytics, Inc.
|
|
6
6
|
License: MIT
|
|
@@ -271,6 +271,22 @@ spooling summarize --backend opencode --model amazon-bedrock/us.anthropic.claude
|
|
|
271
271
|
- `--force` - regenerate even if a summary exists
|
|
272
272
|
- `-y, --yes` - don't ask before sending text to a non-local endpoint
|
|
273
273
|
|
|
274
|
+
#### Summarize one session
|
|
275
|
+
|
|
276
|
+
Name the session by its id (or any unique prefix) and pick the backend:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
spooling session list --title login # find the id first
|
|
280
|
+
spooling summarize ses_e6310bd1 --backend claude-code
|
|
281
|
+
spooling summarize ses_e6310bd1 --backend claude-code --ssh my-other-mac
|
|
282
|
+
spooling session show ses_e6310bd1 # read it back
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
- If the session already has a summary, nothing runs. Add `--force` to replace it, including a summary the provider wrote.
|
|
286
|
+
- Naming a session skips the `--min-messages` filter, so short sessions work too. You can name several: `spooling summarize ID1 ID2 --backend claude-code`.
|
|
287
|
+
- `--dry-run` shows what would run without calling a model, and `-y` skips the confirmation prompt.
|
|
288
|
+
- To avoid typing the backend each time, `export SPOOLING_SUMMARY_BACKEND=claude-code`. There is no environment variable for `--ssh`.
|
|
289
|
+
|
|
274
290
|
#### Using Claude Code or opencode
|
|
275
291
|
|
|
276
292
|
The `claude-code` and `opencode` backends run the agent's headless mode and send the prompt on stdin, so there is no API key to set up: they use whatever login the agent already has. Both send the redacted transcript to that agent's provider, so Spooling asks for confirmation first.
|
|
@@ -471,6 +487,21 @@ spooling push --dry-run # show what would be pushed
|
|
|
471
487
|
|
|
472
488
|
`push` ingests new provider sessions into the local database before uploading, so you don't need to run `spooling sync` first. The server upserts by session id, so re-running is safe.
|
|
473
489
|
|
|
490
|
+
#### When a Free workspace is full
|
|
491
|
+
|
|
492
|
+
The Free plan caps each workspace (500 sessions, 100,000 messages, 5,000 traces). When a push would go past a cap the server answers
|
|
493
|
+
`402`, and `spooling push` stops with a clear message and a non-zero exit code:
|
|
494
|
+
|
|
495
|
+
```
|
|
496
|
+
Free plan limit reached: this workspace can't take more on the Free plan.
|
|
497
|
+
The Free plan allows 500 sessions per workspace. Delete old ones with `spooling cloud delete`, or upgrade at https://app.spooling.ai/settings?tab=billing
|
|
498
|
+
Nothing already pushed was removed; the rest of this push was not sent.
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
Nothing you have already pushed is removed, and sessions already in the workspace can still be updated by a batch that adds no new
|
|
502
|
+
ones. Free space with `spooling cloud delete`, or upgrade from the link. `spooling cloud watch` shows the message once and then a
|
|
503
|
+
short "still at the Free plan limit" line each cycle, and carries on automatically once there is room.
|
|
504
|
+
|
|
474
505
|
### Push only some sessions, or to a specific team
|
|
475
506
|
|
|
476
507
|
**Which team gets the sessions** is decided by the API key you are logged in with. Each key belongs to one workspace (personal or a team), and `spooling push` sends to that workspace. Mint a key for the team in the app, then log in with it:
|
|
@@ -235,6 +235,22 @@ spooling summarize --backend opencode --model amazon-bedrock/us.anthropic.claude
|
|
|
235
235
|
- `--force` - regenerate even if a summary exists
|
|
236
236
|
- `-y, --yes` - don't ask before sending text to a non-local endpoint
|
|
237
237
|
|
|
238
|
+
#### Summarize one session
|
|
239
|
+
|
|
240
|
+
Name the session by its id (or any unique prefix) and pick the backend:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
spooling session list --title login # find the id first
|
|
244
|
+
spooling summarize ses_e6310bd1 --backend claude-code
|
|
245
|
+
spooling summarize ses_e6310bd1 --backend claude-code --ssh my-other-mac
|
|
246
|
+
spooling session show ses_e6310bd1 # read it back
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
- If the session already has a summary, nothing runs. Add `--force` to replace it, including a summary the provider wrote.
|
|
250
|
+
- Naming a session skips the `--min-messages` filter, so short sessions work too. You can name several: `spooling summarize ID1 ID2 --backend claude-code`.
|
|
251
|
+
- `--dry-run` shows what would run without calling a model, and `-y` skips the confirmation prompt.
|
|
252
|
+
- To avoid typing the backend each time, `export SPOOLING_SUMMARY_BACKEND=claude-code`. There is no environment variable for `--ssh`.
|
|
253
|
+
|
|
238
254
|
#### Using Claude Code or opencode
|
|
239
255
|
|
|
240
256
|
The `claude-code` and `opencode` backends run the agent's headless mode and send the prompt on stdin, so there is no API key to set up: they use whatever login the agent already has. Both send the redacted transcript to that agent's provider, so Spooling asks for confirmation first.
|
|
@@ -435,6 +451,21 @@ spooling push --dry-run # show what would be pushed
|
|
|
435
451
|
|
|
436
452
|
`push` ingests new provider sessions into the local database before uploading, so you don't need to run `spooling sync` first. The server upserts by session id, so re-running is safe.
|
|
437
453
|
|
|
454
|
+
#### When a Free workspace is full
|
|
455
|
+
|
|
456
|
+
The Free plan caps each workspace (500 sessions, 100,000 messages, 5,000 traces). When a push would go past a cap the server answers
|
|
457
|
+
`402`, and `spooling push` stops with a clear message and a non-zero exit code:
|
|
458
|
+
|
|
459
|
+
```
|
|
460
|
+
Free plan limit reached: this workspace can't take more on the Free plan.
|
|
461
|
+
The Free plan allows 500 sessions per workspace. Delete old ones with `spooling cloud delete`, or upgrade at https://app.spooling.ai/settings?tab=billing
|
|
462
|
+
Nothing already pushed was removed; the rest of this push was not sent.
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
Nothing you have already pushed is removed, and sessions already in the workspace can still be updated by a batch that adds no new
|
|
466
|
+
ones. Free space with `spooling cloud delete`, or upgrade from the link. `spooling cloud watch` shows the message once and then a
|
|
467
|
+
short "still at the Free plan limit" line each cycle, and carries on automatically once there is room.
|
|
468
|
+
|
|
438
469
|
### Push only some sessions, or to a specific team
|
|
439
470
|
|
|
440
471
|
**Which team gets the sessions** is decided by the API key you are logged in with. Each key belongs to one workspace (personal or a team), and `spooling push` sends to that workspace. Mint a key for the team in the app, then log in with it:
|
|
@@ -171,9 +171,23 @@ def _explain_error_impl(e: BaseException, base: str) -> str:
|
|
|
171
171
|
return escape(str(e) or type(e).__name__)
|
|
172
172
|
|
|
173
173
|
|
|
174
|
+
# Stable first words of the 402 explanation, so `watch` can tell "workspace is full" from a real failure.
|
|
175
|
+
PLAN_LIMIT = "Free plan limit reached"
|
|
176
|
+
|
|
177
|
+
|
|
174
178
|
def _explain_http(e: "httpx.HTTPStatusError") -> str:
|
|
175
179
|
code = e.response.status_code
|
|
176
180
|
body = escape(e.response.text[:200])
|
|
181
|
+
if code == 402:
|
|
182
|
+
try:
|
|
183
|
+
detail = e.response.json().get("detail")
|
|
184
|
+
except Exception: # noqa: BLE001 - a proxy's HTML page, an empty body...
|
|
185
|
+
detail = None
|
|
186
|
+
return (
|
|
187
|
+
f"{PLAN_LIMIT}: this workspace can't take more on the Free plan.\n"
|
|
188
|
+
f" {escape(str(detail)) if detail else body}\n"
|
|
189
|
+
f" Nothing already pushed was removed; the rest of this push was not sent."
|
|
190
|
+
)
|
|
177
191
|
if code == 401:
|
|
178
192
|
return (
|
|
179
193
|
f"HTTP 401: the server rejected your API key.\n"
|
|
@@ -927,6 +941,7 @@ def cloud_watch(interval: int, limit: int, batch: int, lookback: int, no_redact:
|
|
|
927
941
|
|
|
928
942
|
console.print(f"[cyan]Watching local sessions → {base}[/cyan]")
|
|
929
943
|
console.print(f" interval: {interval}s · lookback: {lookback}m · starting watermark: {watermark or 'none (full first push)'}")
|
|
944
|
+
limit_warned = False
|
|
930
945
|
|
|
931
946
|
while not stop["flag"]:
|
|
932
947
|
cycle_started = datetime.now(timezone.utc)
|
|
@@ -954,9 +969,18 @@ def cloud_watch(interval: int, limit: int, batch: int, lookback: int, no_redact:
|
|
|
954
969
|
if redaction_count:
|
|
955
970
|
console.print(f" [dim]Redacted {redaction_count} secret(s) before push[/dim]")
|
|
956
971
|
total, rejected, err = _push_batches(sessions, batch, base, headers, console.print)
|
|
957
|
-
if err:
|
|
972
|
+
if err and err.startswith(PLAN_LIMIT):
|
|
973
|
+
# A full workspace will not fix itself, so say it clearly once and then stay quiet instead of repeating it.
|
|
974
|
+
if not limit_warned:
|
|
975
|
+
console.print(f"[red]{err}[/red]")
|
|
976
|
+
console.print(" [dim]Watch keeps running and tries again each cycle, so it resumes as soon as you upgrade or free some space.[/dim]")
|
|
977
|
+
limit_warned = True
|
|
978
|
+
else:
|
|
979
|
+
console.print(f"[dim]{ts}[/dim] [yellow]still at the Free plan limit; nothing was sent[/yellow]")
|
|
980
|
+
elif err:
|
|
958
981
|
console.print(f"[red]{err.splitlines()[0]}[/red] (will retry next cycle)")
|
|
959
982
|
else:
|
|
983
|
+
limit_warned = False
|
|
960
984
|
# Advance watermark to the cycle start; the lookback window catches
|
|
961
985
|
# sessions whose started_at slid backwards or whose messages were
|
|
962
986
|
# appended after the original started_at.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spooling
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.19
|
|
4
4
|
Summary: Local session tracker and semantic search for AI coding assistants
|
|
5
5
|
Author: Parsed Analytics, Inc.
|
|
6
6
|
License: MIT
|
|
@@ -271,6 +271,22 @@ spooling summarize --backend opencode --model amazon-bedrock/us.anthropic.claude
|
|
|
271
271
|
- `--force` - regenerate even if a summary exists
|
|
272
272
|
- `-y, --yes` - don't ask before sending text to a non-local endpoint
|
|
273
273
|
|
|
274
|
+
#### Summarize one session
|
|
275
|
+
|
|
276
|
+
Name the session by its id (or any unique prefix) and pick the backend:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
spooling session list --title login # find the id first
|
|
280
|
+
spooling summarize ses_e6310bd1 --backend claude-code
|
|
281
|
+
spooling summarize ses_e6310bd1 --backend claude-code --ssh my-other-mac
|
|
282
|
+
spooling session show ses_e6310bd1 # read it back
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
- If the session already has a summary, nothing runs. Add `--force` to replace it, including a summary the provider wrote.
|
|
286
|
+
- Naming a session skips the `--min-messages` filter, so short sessions work too. You can name several: `spooling summarize ID1 ID2 --backend claude-code`.
|
|
287
|
+
- `--dry-run` shows what would run without calling a model, and `-y` skips the confirmation prompt.
|
|
288
|
+
- To avoid typing the backend each time, `export SPOOLING_SUMMARY_BACKEND=claude-code`. There is no environment variable for `--ssh`.
|
|
289
|
+
|
|
274
290
|
#### Using Claude Code or opencode
|
|
275
291
|
|
|
276
292
|
The `claude-code` and `opencode` backends run the agent's headless mode and send the prompt on stdin, so there is no API key to set up: they use whatever login the agent already has. Both send the redacted transcript to that agent's provider, so Spooling asks for confirmation first.
|
|
@@ -471,6 +487,21 @@ spooling push --dry-run # show what would be pushed
|
|
|
471
487
|
|
|
472
488
|
`push` ingests new provider sessions into the local database before uploading, so you don't need to run `spooling sync` first. The server upserts by session id, so re-running is safe.
|
|
473
489
|
|
|
490
|
+
#### When a Free workspace is full
|
|
491
|
+
|
|
492
|
+
The Free plan caps each workspace (500 sessions, 100,000 messages, 5,000 traces). When a push would go past a cap the server answers
|
|
493
|
+
`402`, and `spooling push` stops with a clear message and a non-zero exit code:
|
|
494
|
+
|
|
495
|
+
```
|
|
496
|
+
Free plan limit reached: this workspace can't take more on the Free plan.
|
|
497
|
+
The Free plan allows 500 sessions per workspace. Delete old ones with `spooling cloud delete`, or upgrade at https://app.spooling.ai/settings?tab=billing
|
|
498
|
+
Nothing already pushed was removed; the rest of this push was not sent.
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
Nothing you have already pushed is removed, and sessions already in the workspace can still be updated by a batch that adds no new
|
|
502
|
+
ones. Free space with `spooling cloud delete`, or upgrade from the link. `spooling cloud watch` shows the message once and then a
|
|
503
|
+
short "still at the Free plan limit" line each cycle, and carries on automatically once there is room.
|
|
504
|
+
|
|
474
505
|
### Push only some sessions, or to a specific team
|
|
475
506
|
|
|
476
507
|
**Which team gets the sessions** is decided by the API key you are logged in with. Each key belongs to one workspace (personal or a team), and `spooling push` sends to that workspace. Mint a key for the team in the app, then log in with it:
|
|
@@ -28,7 +28,7 @@ class _Handler(BaseHTTPRequestHandler):
|
|
|
28
28
|
|
|
29
29
|
def _go(self):
|
|
30
30
|
type(self).seen.append(f"{self.command} {self.path}")
|
|
31
|
-
payload = json.dumps(type(self).body if type(self).status == 200 else {"detail": "nope"}).encode()
|
|
31
|
+
payload = json.dumps(type(self).body if type(self).status == 200 else getattr(type(self), "error_body", {"detail": "nope"})).encode()
|
|
32
32
|
self.send_response(type(self).status)
|
|
33
33
|
if type(self).status == 429:
|
|
34
34
|
self.send_header("Retry-After", "42")
|
|
@@ -194,6 +194,28 @@ def test_push_success_exits_zero(logged_in, server, monkeypatch):
|
|
|
194
194
|
assert "POST /v1/sessions/batch" in server.handler.seen
|
|
195
195
|
|
|
196
196
|
|
|
197
|
+
FULL = {"detail": "The Free plan allows 500 sessions per workspace. Delete old ones with `spooling cloud delete`, or upgrade at https://app.spooling.ai/settings?tab=billing"}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def test_a_full_free_workspace_gets_a_clear_message_and_a_nonzero_exit(logged_in, server, monkeypatch):
|
|
201
|
+
server.handler.status, server.handler.error_body = 402, FULL
|
|
202
|
+
logged_in(server.url)
|
|
203
|
+
monkeypatch.setattr(cloud, "_collect_sessions", lambda **k: one_session())
|
|
204
|
+
r = run("push", "--no-sync")
|
|
205
|
+
assert r.exit_code == 1 and "Done." not in r.output
|
|
206
|
+
assert cloud.PLAN_LIMIT in r.output
|
|
207
|
+
assert "settings?tab=billing" in r.output and "spooling cloud delete" in r.output # the server's own words, not raw JSON
|
|
208
|
+
assert "Nothing already pushed was removed" in r.output
|
|
209
|
+
assert '{"detail"' not in r.output
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def test_a_402_without_json_still_explains_itself():
|
|
213
|
+
req = httpx.Request("POST", "http://x/v1/sessions/batch")
|
|
214
|
+
e = httpx.HTTPStatusError("402", request=req, response=httpx.Response(402, text="<html>Payment Required</html>", request=req))
|
|
215
|
+
msg = cloud._explain_http(e)
|
|
216
|
+
assert msg.startswith(cloud.PLAN_LIMIT) and "Payment Required" in msg
|
|
217
|
+
|
|
218
|
+
|
|
197
219
|
@pytest.mark.parametrize("status", [401, 500])
|
|
198
220
|
def test_push_server_error_exits_nonzero(logged_in, server, monkeypatch, status):
|
|
199
221
|
server.handler.status = status
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|