Download tests/test_harvey_ingest.py from legexbenchmark/code: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/datasets/legexbenchmark/code/resolve/main/tests/test_harvey_ingest.py
- Command line
-
hf download hf://datasets/legexbenchmark/code/tests/test_harvey_ingest.py
-
curl -L -o test_harvey_ingest.py https://huggingface.co/datasets/legexbenchmark/code/resolve/main/tests/test_harvey_ingest.py
1.13 kB
| """Harvey ingest: folder normalization and export-layout detection.""" | |
| import pytest | |
| from legex.harvey import _folder_to_cc, _value_columns | |
| # Old and new export names | |
| def test_folder_to_cc(folder, cc): | |
| assert _folder_to_cc(folder) == cc | |
| def test_value_columns_new_layout(): | |
| # 3 meta cols + 12 questions x 2 (Answer/Citations) = 27 | |
| m = _value_columns(27) | |
| assert m[5] == "legal_subject_judgement" | |
| assert m[7] == "trial_start_date" | |
| assert m[25] == "defendant_no1_ISIC1_industry_category" | |
| assert 3 not in m | |
| def test_value_columns_old_layout(): | |
| # 3 meta cols + 12 questions x 4 = 51 | |
| m = _value_columns(51) | |
| assert m[7] == "legal_subject_judgement" | |
| assert m[11] == "trial_start_date" | |
| assert m[47] == "defendant_no1_ISIC1_industry_category" | |