from pathlib import Path
import json
R=Path(__file__).resolve().parent
cases=json.loads((R/'fixtures/cases.json').read_text(encoding='utf-8'))['cases']
assert len(cases)==8
for c in cases:
    assert c['id'] and c['item'] and c['source_id']
    assert c['rights_record'] in {'ALLOW','DENY','UNKNOWN'}
    assert c['intended_use'] in {'REPRODUCE','ADAPT','PUBLIC_RELEASE','INTERNAL_USE'}
    assert isinstance(c['allowed_uses'],list)
    assert isinstance(c['citation_present'],bool)
    assert 'post_approved_canon_version' in c and 'post_rights_record' in c
print('PASS learner fixtures: 8 synthetic rights/canon policy cases')
