Skip to content

Commit

Permalink
Merge pull request #172 from noskill/main
Browse files Browse the repository at this point in the history
handle current_mission_record empty path
  • Loading branch information
noskill authored Jul 4, 2024
2 parents d71cfad + c95bc0a commit 6cf1bc5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
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

0 comments on commit 6cf1bc5

Please sign in to comment.