def test_inject_suffixes(self): if 'DYLD_IMAGE_SUFFIX' in os.environ: del os.environ['DYLD_IMAGE_SUFFIX'] # No suffix paths = [ '/usr/lib/libSystem.dylib', '/lib/libfoo.3.dylib', '/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython', '/System/Library/Frameworks/CorePython.framework/CorePython', ] self.assertEqual(list(dyld.inject_suffixes(iter(paths))), paths) self.assertIs(dyld.inject_suffixes(paths), paths) os.environ['DYLD_IMAGE_SUFFIX'] = '_DEBUG' self.maxDiff = None self.assertEqual(list(dyld.inject_suffixes(iter(paths))), [ '/usr/lib/libSystem_DEBUG.dylib', '/usr/lib/libSystem.dylib', '/lib/libfoo.3_DEBUG.dylib', '/lib/libfoo.3.dylib', '/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython_DEBUG', '/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython', '/System/Library/Frameworks/CorePython.framework/CorePython_DEBUG', '/System/Library/Frameworks/CorePython.framework/CorePython', ])
def test_inject_suffixes(self): if "DYLD_IMAGE_SUFFIX" in os.environ: del os.environ["DYLD_IMAGE_SUFFIX"] # No suffix paths = [ "/usr/lib/libSystem.dylib", "/lib/libfoo.3.dylib", "/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython", "/System/Library/Frameworks/CorePython.framework/CorePython", ] self.assertEqual(list(dyld.inject_suffixes(iter(paths))), paths) self.assertIs(dyld.inject_suffixes(paths), paths) os.environ["DYLD_IMAGE_SUFFIX"] = "_DEBUG" self.maxDiff = None self.assertEqual( list(dyld.inject_suffixes(iter(paths))), [ "/usr/lib/libSystem_DEBUG.dylib", "/usr/lib/libSystem.dylib", "/lib/libfoo.3_DEBUG.dylib", "/lib/libfoo.3.dylib", "/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython_DEBUG", "/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython", "/System/Library/Frameworks/CorePython.framework/CorePython_DEBUG", "/System/Library/Frameworks/CorePython.framework/CorePython", ], )