from __future__ import annotations

import unittest

from reliability_core.regressions import run_rg


class RegressionAttackTests(unittest.TestCase):
    pass


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


for _number in range(1, 19):
    _id = f"RG-{_number:02d}"
    setattr(RegressionAttackTests, f"test_rg_{_number:02d}", _make(_id))


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