Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Dec 19, 2024
1 parent 40ad447 commit 2bc9bc2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/test_xacro.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,23 @@
def subTest(msg):
yield None

# Determine if we are running the test under bazel and switch directory
try:
# Determine if we are running the test under bazel and switch to runfiles directory
from python.runfiles import runfiles

data_path = runfiles.Create().Rlocation("_main/test")
os.chdir(data_path)

# Set the executable path
XACRO_EXECUTABLE = runfiles.Create().Rlocation("_main/xacro_main")
BAZEL_TEST = True
except ImportError:
XACRO_EXECUTABLE = 'xacro'
BAZEL_TEST = False

# regex to match whitespace
whitespace = re.compile(r'\s+')


def text_values_match(a, b):
# generic comparison
if whitespace.sub(' ', a).strip() == whitespace.sub(' ', b).strip():
Expand Down

0 comments on commit 2bc9bc2

Please sign in to comment.