Metadata-Version: 2.4
Name: watchlight-agent-sdk-testing
Version: 0.1.1
Summary: Test doubles and the conformance runner for Watchlight Agent SDK plugins (tests only)
Author-email: Watchlight AI <team@watchlight.ai>
License-Expression: Apache-2.0
Project-URL: Homepage, https://www.watchlight.ai
Project-URL: Documentation, https://docs.watchlight.ai/de
Project-URL: Repository, https://github.com/watchlight-ai-beacon/watchlight-de
Project-URL: Issues, https://github.com/watchlight-ai-beacon/watchlight-de/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Framework :: Pytest
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Testing
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: watchlight-agent-sdk<0.13,>=0.12.0
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
Dynamic: license-file

# watchlight-agent-sdk-testing

Test doubles and the conformance runner for plugins built on
[`watchlight-agent-sdk`](../watchlight-core). For tests only: it depends
on the SDK, the SDK never depends on it, and none of it ships in the SDK.

```bash
pip install watchlight-agent-sdk-testing
```

```python
from watchlight_core_testing import MockApdpClient

client = MockApdpClient()              # denies every request
client.default_decision = "Allow"      # a test that needs allows says so
client.decisions[("execute", "fs.write")] = "Deny"
```

`MockApdpClient` denies by default. A test that needs an allow sets
`default_decision="Allow"` or a per-`(action, resource)` rule, so no test
passes because the double allowed by omission.

## Conformance

```bash
python -m watchlight_core_testing.conformance my_plugin_package
# or
watchlight-conformance my_plugin_package
```

## Moving from `watchlight_core.testing`

| Before | After |
|---|---|
| `from watchlight_core.testing import X` | `from watchlight_core_testing import X` |
| `from watchlight_core.conformance import X` | `from watchlight_core_testing.conformance import X` |
| `python -m watchlight_core.conformance` | `python -m watchlight_core_testing.conformance` |

A test that relied on the old allow default now sees denials. Set
`default_decision="Allow"` where the test means to allow.
