Build Project Structure.

New: base classes and modules.
New: unit tests.
This commit is contained in:
Sunday 2023-05-22 17:10:59 +08:00
parent dba4698ad4
commit 9481e6fcaa
7 changed files with 31 additions and 0 deletions

0
__init__.py Normal file
View File

0
core/__init__.py Normal file
View File

2
core/base/ResultBase.py Normal file
View File

@ -0,0 +1,2 @@
class ResultBase():
pass

View File

@ -0,0 +1,9 @@
import abc
class SimulationBase():
@abc.abstractclassmethod
def run(self):
pass
pass

2
core/base/__init__.py Normal file
View File

@ -0,0 +1,2 @@
from .ResultBase import ResultBase
from .SimulationBase import SimulationBase

0
tests/__init__.py Normal file
View File

18
tests/test_base.py Normal file
View File

@ -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()