diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/__init__.py b/core/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/base/ResultBase.py b/core/base/ResultBase.py new file mode 100644 index 0000000..e1abbce --- /dev/null +++ b/core/base/ResultBase.py @@ -0,0 +1,2 @@ +class ResultBase(): + pass diff --git a/core/base/SimulationBase.py b/core/base/SimulationBase.py new file mode 100644 index 0000000..fa985b5 --- /dev/null +++ b/core/base/SimulationBase.py @@ -0,0 +1,9 @@ +import abc + + +class SimulationBase(): + @abc.abstractclassmethod + def run(self): + pass + + pass diff --git a/core/base/__init__.py b/core/base/__init__.py new file mode 100644 index 0000000..da7f6e8 --- /dev/null +++ b/core/base/__init__.py @@ -0,0 +1,2 @@ +from .ResultBase import ResultBase +from .SimulationBase import SimulationBase diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_base.py b/tests/test_base.py new file mode 100644 index 0000000..204fc17 --- /dev/null +++ b/tests/test_base.py @@ -0,0 +1,18 @@ +import unittest + +from haocrowd.core.base import SimulationBase + + +class TestBase(unittest.TestCase): + + def test_basic(self): + class MySim(SimulationBase): + def run(self) -> str: + return "HelloSim" + + mysim = MySim() + self.assertEqual(mysim.run(), "HelloSim") + + +if __name__ == "__main__": + unittest.main()