Datasets:
File size: 1,050 Bytes
f164cc9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | import ast
import random
from oellm_code_rlvr.families import FAMILIES
from oellm_code_rlvr.generate import build_row, split_for
def test_all_families_are_deterministic_and_mutation_tested():
for name, family in FAMILIES.items():
left = family(random.Random(42), 3)
right = family(random.Random(42), 3)
assert left == right
assert left.mutation_score >= 2 / 3
assert len(left.public_tests) == 2
assert len(left.hidden_tests) >= 8
ast.parse(left.reference_solution)
def test_rows_match_open_r1_contract():
for index, family in enumerate(FAMILIES):
row = build_row(family, 1000 + index)
assert row["messages"][0]["role"] == "user"
assert row["verification_info"]["language"] == "python"
assert all(case["type"] == "stdin_stdout" for case in row["verification_info"]["test_cases"])
assert row["verifier_kind"] == "code_stdio"
def test_split_is_stable():
group = "oellm-code-test-000000001"
assert split_for(group) == split_for(group)
|