Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle current_mission_record empty path #172

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tagilmo/VereyaPython/agent_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,10 @@ def onMissionControlMessage(self, xml: TimestampedString) -> Optional[None]:
return
assert self.current_mission_record is not None
if self.current_mission_record.isRecording():
missionEndedXML = open(self.current_mission_record.getMissionEndedPath(), 'w')
missionEndedXML.write(xml.text)
missionEndedXML.close()
if self.current_mission_record.getMissionEndedPath():
missionEndedXML = open(self.current_mission_record.getMissionEndedPath(), 'w')
missionEndedXML.write(xml.text)
missionEndedXML.close()
self.close()
elif root_node_name == "ping":
# The mod is pinging us to check we are still around - do nothing.
Expand Down
2 changes: 1 addition & 1 deletion tests/vereya/test_motion_mob.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestMotionMob(TestMotion):
@classmethod
def setUpClass(cls, *args, **kwargs):
start = (-151.0, -213.0)
mc, obs = init_mission(None, start_x=start[0], start_z=start[1], forceReset='true', seed='43')
mc, obs = init_mission(None, start_x=start[0], start_z=start[1], start_y=65, forceReset='true', seed='43')
cls.mc = mc
cls.obs = obs
assert mc.safeStart()
Expand Down
4 changes: 2 additions & 2 deletions tests/vereya/test_motion_vereya.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestMotion(BaseTest):
@classmethod
def setUpClass(cls, *args, **kwargs):
start = (-151.0, -213.0)
mc, obs = init_mission(None, start_x=start[0],start_z=start[1], forceReset='true', seed='43')
mc, obs = init_mission(None, start_x=start[0], start_z=start[1], start_y=66, forceReset='true', seed='43')
cls.mc = mc
cls.obs = obs
assert mc.safeStart()
Expand Down Expand Up @@ -75,8 +75,8 @@ def teadDown(self):
super().tearDown()

def setUp(self):
self.obs.stopMove()
super().setUp()
self.obs.stopMove()

@classmethod
def tearDownClass(cls, *args, **kwargs):
Expand Down
Loading