Skip to content

Commit

Permalink
Jira-DEVS-38
Browse files Browse the repository at this point in the history
유니테스트 폴더 경로 수정 / config.py 파일 생성
  • Loading branch information
sumannam committed Dec 30, 2023
1 parent f43b556 commit 55b7ba0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 23 deletions.
8 changes: 8 additions & 0 deletions test/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import os
import sys

if 'win' in sys.platform: # Windows
sys.path.append('D:/Git/DEVS-Python')
sys.path.append('D:/Git/DEVS-Python/projects/simparc')
else: # Linux, Unix, MacOS
sys.path.append('.')
4 changes: 2 additions & 2 deletions test/testEF_P.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

sys.path.append('D:/Git/DEVS-Python')

from projects.simparc.EF_P import EF_P
from projects.simparc.coupbase.EF_P import EF_P

class testEF_P(unittest.TestCase):
def setUp(self):
Expand All @@ -20,4 +20,4 @@ def testAddModels(self):

def testAddInteralCoupling(self):
coupling_list = self.ef_p.getInternalCoupling()
assert coupling_list.coupling_dic == {'EF.out': 'P.in', 'P.out': 'EF.in'}
assert coupling_list.coupling_dic == {'EF.out': ['P.in'], 'P.out': ['EF.in']}
4 changes: 2 additions & 2 deletions test/testPModelTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

sys.path.append('D:/Git/DEVS-Python')

from projects.simparc.P import P
from projects.simparc.mbase.P import P
from src.CONTENT import CONTENT

class testPModelTest(unittest.TestCase):
Expand Down Expand Up @@ -77,7 +77,7 @@ def test_modeltest_p_inject(self):

send_result = self.p.getInjectResult("inject")

assert send_result == "state s = (4 busy g1 5)"
assert send_result == "state s = (5 busy g1 5)"

if __name__ == '__main__':
start = time.time()
Expand Down
2 changes: 1 addition & 1 deletion test/testROOT_CO_ORDINATORS.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
sys.path.append('D:/Git/DEVS-Python')
sys.path.append('D:/Git/DEVS-Python/projects/simparc')

from projects.simparc.EF_P import EF_P
from projects.simparc.coupbase.EF_P import EF_P

class testROOT_CO_ORDINATORS(unittest.TestCase):
def setUp(self):
Expand Down
37 changes: 19 additions & 18 deletions test/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
import sys
import unittest

sys.path.append('D:/Git/DEVS-Python')
import config

from testPModelTest import testPModelTest
# from testEF_P import testEF_P
# from testROOT_CO_ORDINATORS import testROOT_CO_ORDINATORS
# from testPModelTest import testPModelTest
from testEF_P import testEF_P
from testROOT_CO_ORDINATORS import testROOT_CO_ORDINATORS

# TO-DO : 테스트 실행 파일을 엔진과 모델 테스트로 분리할 것[Jira-DEVS-41]
if __name__ == '__main__':
test_p0 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
test_p1 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
test_p2 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
test_p3 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
test_p4 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
# test_p0 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
# test_p1 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
# test_p2 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
# test_p3 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
# test_p4 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
# test_p5 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
# test_p6 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
# test_p7 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
# test_p8 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
# test_p9 = unittest.TestLoader().loadTestsFromTestCase(testPModelTest)
# test_efp = unittest.TestLoader().loadTestsFromTestCase(testEF_P)
# test_root_coordinators = unittest.TestLoader().loadTestsFromTestCase(testROOT_CO_ORDINATORS)
test_efp = unittest.TestLoader().loadTestsFromTestCase(testEF_P)
test_root_coordinators = unittest.TestLoader().loadTestsFromTestCase(testROOT_CO_ORDINATORS)

allTests = unittest.TestSuite()
allTests.addTest(test_p0)
allTests.addTest(test_p1)
allTests.addTest(test_p2)
allTests.addTest(test_p3)
allTests.addTest(test_p4)
# allTests.addTest(test_p0)
# allTests.addTest(test_p1)
# allTests.addTest(test_p2)
# allTests.addTest(test_p3)
# allTests.addTest(test_p4)
# allTests.addTest(test_p5)
# allTests.addTest(test_p6)
# allTests.addTest(test_p7)
# allTests.addTest(test_p8)
# allTests.addTest(test_p9)
# allTests.addTest(test_efp)
# allTests.addTest(test_root_coordinators)
allTests.addTest(test_efp)
allTests.addTest(test_root_coordinators)

unittest.TextTestRunner(verbosity=2, failfast=True).run(allTests)

0 comments on commit 55b7ba0

Please sign in to comment.