Download tests/test_memory.py from Nikitasoni22/cicd-rl-agent: direct link, hf CLI and curl.
- Browser
- Download file 545 Bytes
-
https://huggingface.co/Nikitasoni22/cicd-rl-agent/resolve/main/tests/test_memory.py
- Command line
-
hf download hf://Nikitasoni22/cicd-rl-agent/tests/test_memory.py
-
curl -L -o test_memory.py https://huggingface.co/Nikitasoni22/cicd-rl-agent/resolve/main/tests/test_memory.py
545 Bytes
| from cicd_debug_env.memory.failure_bank import FailureMemoryBank | |
| from cicd_debug_env.models import Action | |
| def test_memory(): | |
| bank = FailureMemoryBank(store="dict") | |
| act = Action("fail_act", {}, 0.1, "bad") | |
| bank.store("Error 404", act, "Fail", 0.0) | |
| assert len(bank.memory) == 1 | |
| # We used dict fallback implicitly in query logic when passing top matching queries | |
| res = bank.query("Error 404", 1) | |
| assert bank.should_avoid("Error 404", "fail_act") | |
| assert not bank.should_avoid("Error 404", "good_act") | |