claude-dev-env 8.73.0 → 8.73.1
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.
package/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
import _code_review_test_support as support
|
|
8
|
+
from dev_env_scripts_constants.account_broker_constants import Product
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def test_should_build_served_and_exhausted_outcomes() -> None:
|
|
12
|
+
served = support.claude_served(returncode=4, stdout="failed")
|
|
13
|
+
exhausted = support.claude_failed()
|
|
14
|
+
|
|
15
|
+
assert served.returncode == 4
|
|
16
|
+
assert served.stdout == "failed"
|
|
17
|
+
assert served.status == "advisor_blocked"
|
|
18
|
+
assert served.attempts == (("claude", "served"),)
|
|
19
|
+
assert exhausted.returncode == support.WAIT_EXIT_CODE
|
|
20
|
+
assert exhausted.status == "exhausted"
|
|
21
|
+
assert exhausted.attempts == (("claude", "usage_limited"),)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test_should_record_runner_options_from_installed_seam(
|
|
25
|
+
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
|
|
26
|
+
) -> None:
|
|
27
|
+
expected_outcome = support.claude_served()
|
|
28
|
+
call_log = support.install_seams(
|
|
29
|
+
monkeypatch, claude_outcome=expected_outcome
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
outcome = support.invoker.review_claude_runner(
|
|
33
|
+
Product.CLAUDE, ["claude", "-p"], stdin_text="", cwd=tmp_path
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
assert outcome is expected_outcome
|
|
37
|
+
assert call_log.claude_calls == 1
|
|
38
|
+
assert call_log.claude_arguments == ["-p"]
|
|
39
|
+
assert call_log.is_stdin_empty is True
|
|
40
|
+
assert call_log.claude_working_directory == tmp_path
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from types import SimpleNamespace
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
from codec_forwarding_test_support import install_codec_seams
|
|
8
|
+
from dev_env_scripts_constants.account_broker_constants import Product
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def test_should_record_runner_options_and_return_served_outcome(
|
|
12
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
13
|
+
) -> None:
|
|
14
|
+
runner_host = SimpleNamespace(run=None)
|
|
15
|
+
observed_options = install_codec_seams(
|
|
16
|
+
monkeypatch,
|
|
17
|
+
chain_stdout='{"result":"done"}',
|
|
18
|
+
runner_host=runner_host,
|
|
19
|
+
runner_attribute_name="run",
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
outcome = runner_host.run(
|
|
23
|
+
Product.CLAUDE, ["claude", "-p"], encoding="utf-8", errors="replace"
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
assert observed_options == {"encoding": "utf-8", "errors": "replace"}
|
|
27
|
+
assert outcome.stdout == '{"result":"done"}'
|
|
28
|
+
assert outcome.status == "served"
|