Download tools/test_content_scopes.py from Lexmount/LexBench-Web-Fetch: direct link, hf CLI and curl.
- Browser
- Download file 1.48 kB
-
https://huggingface.co/datasets/Lexmount/LexBench-Web-Fetch/resolve/refs%2Fpr%2F8/tools/test_content_scopes.py
- Command line
-
hf download hf://datasets/Lexmount/LexBench-Web-Fetch@refs/pr/8/tools/test_content_scopes.py
-
curl -L -o test_content_scopes.py https://huggingface.co/datasets/Lexmount/LexBench-Web-Fetch/resolve/refs%2Fpr%2F8/tools/test_content_scopes.py
1.48 kB
| """Annotation cohorts add acceptance scopes without changing the released population.""" | |
| from pathlib import Path | |
| import json | |
| import unittest | |
| from test_review_scope import suite_dirs | |
| ROOT = Path(__file__).resolve().parents[1] | |
| class ContentScopesTests(unittest.TestCase): | |
| def test_annotations_reuse_population_and_preserve_both_scopes(self): | |
| tasks = json.loads((ROOT/'definitions/evaluation/content-scopes-530/tasks.json').read_text())['cases'] | |
| population = json.loads((ROOT/'definitions/populations/primary-content-20261103.json').read_text()) | |
| self.assertEqual(len(tasks), 530) | |
| self.assertEqual({c['id'] for c in tasks}, {c['suite']+'--'+c['id'] for c in population['cases']}) | |
| for task in tasks: | |
| self.assertEqual(set(task['content_scopes']) - {'version'}, {'main', 'full'}) | |
| self.assertNotIn('content-scopes-530', suite_dirs()) | |
| self.assertEqual(set(suite_dirs()), set(population['frozen_task_bindings'])) | |
| def test_annotation_registry_does_not_expand_edition(self): | |
| manifest = json.loads((ROOT/'manifest.json').read_text()) | |
| self.assertEqual(manifest['edition']['task_count'], 550) | |
| registry = json.loads((ROOT/'definitions/registry.json').read_text()) | |
| entry = next(s for s in registry['suites'] if s['id']=='content-scopes-530') | |
| self.assertEqual(entry['kind'], 'annotation_cohort') | |
| self.assertEqual(entry['source_population'], 'primary-content-20261103') | |