Skip to content

Commit

Permalink
tests: add Through the Inferno test load mission
Browse files Browse the repository at this point in the history
  • Loading branch information
rp- committed Aug 14, 2020
1 parent 53a909e commit 8b56467
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Binary file added tests/missions/TTI_GC_SC_1.68a.miz
Binary file not shown.
7 changes: 7 additions & 0 deletions tests/test_mission.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest
import os
import dcs
import time
from dcs.translation import String


Expand Down Expand Up @@ -420,10 +421,16 @@ def test_load_prepared_mission(self):
self.assert_prepared_mission_load(m)

def test_load_test_missions(self):
current_milli_time = lambda: int(round(time.time() * 1000))
test_mission_folder = os.path.join(os.path.dirname(__file__), 'missions')
for f in os.listdir(test_mission_folder):
if f.endswith('.miz'):
print('-' * 10, "Loading", f)
start = current_milli_time()
m = dcs.mission.Mission()
self.assertTrue(m.load_file(os.path.join(test_mission_folder, f)))
print('-' * 10, "Loaded", f, "in", current_milli_time() - start, "ms")
print('-' * 10, "Saving", f)
start = current_milli_time()
self.assertTrue(m.save('missions/unittest_' + f))
print('-' * 10, "Saved", f, "in", current_milli_time() - start, "ms")

0 comments on commit 8b56467

Please sign in to comment.