from __future__ import annotations

import unittest

from reliability_core.regressions_r2 import run_r2_rg


class R2RegressionTests(unittest.TestCase):
    pass


def _make(test_id: str):
    def test(self: R2RegressionTests) -> None:
        result = run_r2_rg(test_id)
        self.assertTrue(result.passed, f"{test_id}: {result.assertion}: {result.observed}")
    return test


for _number in range(1, 32):
    _id = f"R2-RG-{_number:02d}"
    setattr(R2RegressionTests, f"test_r2_rg_{_number:02d}", _make(_id))


if __name__ == "__main__":
    unittest.main()
