Spaces:
Runtime error
Runtime error
Download test_evolution.py from Expanded-Repetition/ammo-card: direct link, hf CLI and curl.
- Browser
- Download file 447 Bytes
-
https://huggingface.co/spaces/Expanded-Repetition/ammo-card/resolve/main/test_evolution.py
- Command line
-
hf download hf://spaces/Expanded-Repetition/ammo-card/test_evolution.py
-
curl -L -o test_evolution.py https://huggingface.co/spaces/Expanded-Repetition/ammo-card/resolve/main/test_evolution.py
447 Bytes
| import json | |
| from amo.evolution import _parse_candidate | |
| def test_parse_json_candidate(): | |
| candidate = _parse_candidate(json.dumps({"code": "def f():\n return 1", "summary": "simple"})) | |
| assert "return 1" in candidate.code | |
| assert candidate.summary == "simple" | |
| def test_parse_fenced_python_fallback(): | |
| candidate = _parse_candidate("Here is code:\n```python\ndef f():\n return 1\n```") | |
| assert "return 1" in candidate.code | |