Skip to content

Commit

Permalink
Add bind list test
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce Gattis <[email protected]>
  • Loading branch information
BryceGattis committed Apr 7, 2024
1 parent eb3c2b9 commit c5a405f
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/rez/tests/test_cli_bind.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
test running rez bind commandline tool
"""
import rez
from rez.tests.util import restore_os_environ, TestBase, TempdirMixin
import os.path
import subprocess
Expand Down Expand Up @@ -76,6 +77,44 @@ def test_custom_path(self):
package_exists = os.path.exists(os.path.join(custom_path, 'platform'))
self.assertTrue(package_exists)

def test_list(self):
"""run list bind test"""

# skip if cli not available
if not system.rez_bin_path:
self.skipTest("Not a production install")

binfile = os.path.join(system.rez_bin_path, 'rez-bind')
proc = subprocess.run([binfile, "-l"],
capture_output=True, text=True)
output = proc.stdout
self.assertIn("PACKAGE BIND MODULE", output)
self.assertIn("------- -----------", output)
expected_bind_packages = [
"arch",
"cmake",
"gcc",
"hello_world",
"os",
"pip",
"platform",
"PyQt",
"PySide",
"python",
"rez",
"rezgui",
"setuptools",
"sip"
]
for expected_bind_pkg in expected_bind_packages:
expected_bind_file_path = os.path.join(
rez.module_root_path,
'bind',
expected_bind_pkg + '.py'
)
self.assertIn(expected_bind_pkg, output)
self.assertIn(expected_bind_file_path, output)


if __name__ == '__main__':
unittest.main()

0 comments on commit c5a405f

Please sign in to comment.