Skip to content

Commit

Permalink
mission_planner_test.py done
Browse files Browse the repository at this point in the history
  • Loading branch information
PRANETALLU committed Nov 11, 2023
1 parent bc1823e commit 03a902a
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ def mission_cb(self, mission):
self.results.append((status, name))

def myassert(self, my_res):
"""_summary_
"""
This prints out whether the intended result has been matched or prints an error message
Args:
my_res (_type_): _description_
my_res (array): array that is being compared
"""
passed = True
if len(my_res) != len(self.results):
Expand Down Expand Up @@ -65,6 +66,10 @@ def myassert(self, my_res):
self.count += 1

def create_spoofs(self):
"""
A "SpoofGenerator" instance has been created by assigning a preset values to each attribute
"""
sg = SpoofGenerator()
empty = PerceptionObjectArray()
stc = PerceptionObjectArray()
Expand Down Expand Up @@ -166,6 +171,9 @@ def create_spoofs(self):
)

async def run_tests(self):
"""
A test for each yaml file is being run while passing the parameters for each instance.
"""
await self.pub_base_mission.start(self.nh)
sub = self.nh.subscribe("/mission_planner/mission", String, self.mission_cb)
await sub.setup()
Expand Down Expand Up @@ -277,6 +285,17 @@ async def run_tests(self):
fprint(f"{self.count} Missions passed", msg_color="green")

async def _run_mission(self, yaml_file, spoof_pub, spoof_service, time, desc, res):
"""This runs the process starting with the yaml file while also passing in attributes of an object.
This confirms whether the tests are successful.
Args:
yaml_file (_type_): _description_
spoof_pub (_type_): _description_
spoof_service (_type_): _description_
time (_type_): _description_
desc (_type_): _description_
res (_type_): _description_
"""
with open(yaml_file) as stream:
try:
spoof_pub.start(self.nh)
Expand Down

0 comments on commit 03a902a

Please sign in to comment.