from __future__ import annotations

import unittest

from reliability_core.regressions_r3 import run_r3_rg


class R3RegressionTests(unittest.TestCase):
    pass


def _make(test_id: str):
    def test(self: R3RegressionTests) -> None:
        result = run_r3_rg(test_id)
        self.assertTrue(result.passed, f"{test_id}: {result.assertion}: {result.observed}")
    test.__name__ = "test_" + test_id.lower().replace("-", "_")
    return test


for _number in range(1, 20):
    _id = f"R3-RG-{_number:02d}"
    setattr(R3RegressionTests, f"test_r3_rg_{_number:02d}", _make(_id))
