Skip to content

Commit

Permalink
Use platform-agnostic path manipulation in test_packages.py (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay authored Apr 4, 2024
1 parent 6aeb5a1 commit 9a09b99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _create_pkg_in_dir(path, version='0.1.0'):
<maintainer email="[email protected]">Foo Bar</maintainer>
</package>
""".format(path.split('/')[-1], version)
""".format(os.path.basename(path), version)

with open(os.path.join(path, 'package.xml'), 'w+') as f:
f.write(template)
Expand All @@ -52,10 +52,10 @@ def test_find_packages_allowing_duplicates_with_no_packages():
@in_temporary_directory
def test_find_packages_invalid_version():
version = ':{version}'
path = 'src/foo'
path = os.path.join('src', 'foo')
_create_pkg_in_dir(path, version)
try:
find_packages(path.split('/')[0])
find_packages(os.path.dirname(path))
assert False, 'Must raise'
except InvalidPackage as e:
exception_message = str(e)
Expand Down

0 comments on commit 9a09b99

Please sign in to comment.