forked from AcademySoftwareFoundation/rez
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for overriding built-in bind modules (AcademySoftwareFoun…
…dation#1619) * Issue AcademySoftwareFoundation#1557 - Add support for overriding built-in bind modules. Signed-off-by: Michael Nowakowski <[email protected]> * Add copyrights Signed-off-by: Jean-Christophe Morin <[email protected]> * Add test for get_bind_modules Signed-off-by: Jean-Christophe Morin <[email protected]> --------- Signed-off-by: Michael Nowakowski <[email protected]> Signed-off-by: Jean-Christophe Morin <[email protected]> Co-authored-by: Jean-Christophe Morin <[email protected]> Signed-off-by: Jose Enriquez <[email protected]>
- Loading branch information
1 parent
dccddda
commit ad2b3bf
Showing
4 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Custom bind module override | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright Contributors to the Rez Project | ||
|
||
|
||
""" | ||
test package_bind module | ||
""" | ||
import os | ||
import unittest | ||
from rez import package_bind | ||
from rez.tests.util import TestBase | ||
|
||
|
||
class TestPackageBind(TestBase): | ||
def test_get_bind_modules(self): | ||
"""Test get_bind_modules returns the expected modules""" | ||
self.assertEqual( | ||
sorted(package_bind.get_bind_modules().keys()), | ||
[ | ||
"PyQt", | ||
"PySide", | ||
"arch", | ||
"cmake", | ||
"gcc", | ||
"hello_world", | ||
"os", | ||
"pip", | ||
"platform", | ||
"python", | ||
"rez", | ||
"rezgui", | ||
"setuptools", | ||
"sip", | ||
] | ||
) | ||
|
||
def test_os_module_override(self): | ||
"""Test that bind_module_path can override built-in bind modules""" | ||
self.update_settings({ | ||
"bind_module_path": [self.data_path("bind")] | ||
}) | ||
|
||
os_module_path = os.path.join(self.data_path("bind"), "os.py") | ||
os_bind_module = package_bind.find_bind_module("os") | ||
self.assertEqual(os_bind_module, os_module_path) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |