from __future__ import annotations

import unittest

from reliability_core.harness import AcceptanceHarness


class AcceptanceTests(unittest.TestCase):
    """AT-01..AT-20 are executed from independent stores."""


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


for _number in range(1, 21):
    _id = f"AT-{_number:02d}"
    setattr(AcceptanceTests, f"test_at_{_number:02d}", _make(_id))


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

