Skip to content

Commit

Permalink
test_fix_all.py: refactor so an isaac-specific test can easily inheri…
Browse files Browse the repository at this point in the history
…t from the astrobee test (nasa#494)
  • Loading branch information
trey0 authored and marinagmoreira committed Jun 3, 2022
1 parent 01258c2 commit 2ea123a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tools/bag_processing/test/test_fix_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import glob
import os
import subprocess
import sys
import unittest

Expand All @@ -32,11 +33,18 @@ def dosys(cmd):
return ret


def get_path(ros_package, subpath):
cmd = ["catkin_find", "--first-only", ros_package, subpath]
return subprocess.check_output(cmd).decode("utf-8").strip()


class TestFixAll(unittest.TestCase):
def get_test_bags_folder(self):
return get_path("bag_processing", "test/bags")

def test_fix_all(self):
bp_folder = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
fix_all = os.path.join(bp_folder, "scripts/rosbag_fix_all.py")
bags_folder = os.path.join(bp_folder, "test/bags")
fix_all = get_path("bag_processing", "scripts/rosbag_fix_all.py")
bags_folder = self.get_test_bags_folder()
bags = os.path.join(bags_folder, "*.bag")

bag_list = glob.glob(bags)
Expand Down

0 comments on commit 2ea123a

Please sign in to comment.