-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TST: Avoid more package collisions in tests
- Loading branch information
Showing
4 changed files
with
69 additions
and
61 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
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
100 changes: 52 additions & 48 deletions
100
tests/test-recipes/split-packages/copying_files/subpackage_test.py
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 |
---|---|---|
@@ -1,69 +1,73 @@ | ||
import os | ||
|
||
if os.getenv('PKG_NAME') == 'my_script_subpackage_files': | ||
if os.getenv("PKG_NAME") == "my_script_subpackage_files": | ||
file_basename = "subpackage_file" | ||
dirname = "somedir" | ||
extension = "ext" | ||
|
||
file_basename = 'subpackage_file1' | ||
external_host_file = "lib/libpng16.so" | ||
if "osx" in os.getenv("target_platform", ""): | ||
external_host_file = "lib/libpng16.dylib" | ||
if "win" in os.getenv("target_platform", ""): | ||
external_host_file = "Library/bin/libpng16.dll" | ||
|
||
external_host_file = 'lib/libpng16.so' | ||
if 'osx' in os.getenv('target_platform', ''): | ||
external_host_file = 'lib/libpng16.dylib' | ||
if 'win' in os.getenv('target_platform', ''): | ||
external_host_file = 'Library/bin/libpng16.dll' | ||
filename = os.path.join(os.environ["PREFIX"], f"{file_basename}3.{extension}") | ||
print(filename) | ||
assert os.path.isfile(filename), filename + " is missing" | ||
print("glob files OK") | ||
|
||
filename = os.path.join(os.environ['PREFIX'], f'{file_basename}3.ext') | ||
assert os.path.isfile(filename) | ||
print('glob files OK') | ||
filename = os.path.join(os.environ["PREFIX"], external_host_file) | ||
print(filename) | ||
assert os.path.isfile(filename), filename + " is missing" | ||
print("glob files prefix OK") | ||
|
||
filename = os.path.join(os.environ['PREFIX'], external_host_file) | ||
assert os.path.isfile(filename) | ||
print('glob files prefix OK') | ||
if os.getenv("PKG_NAME") == "my_script_subpackage_include_exclude": | ||
file_basename = "subpackage_include_exclude" | ||
dirname = "anotherdir" | ||
extension = "wav" | ||
|
||
if os.getenv('PKG_NAME') == 'my_script_subpackage_include_exclude': | ||
external_host_file = "lib/libdav1d.so.6" | ||
if "osx" in os.getenv("target_platform", ""): | ||
external_host_file = "lib/libdav1d.6.dylib" | ||
if "win" in os.getenv("target_platform", ""): | ||
external_host_file = "Library/bin/dav1d.dll" | ||
|
||
file_basename = 'subpackage_include_exclude1' | ||
filename = os.path.join(os.environ["PREFIX"], f"{file_basename}3.{extension}") | ||
assert not os.path.isfile(filename), filename + " is missing" | ||
print("glob exclude OK") | ||
|
||
external_host_file = 'lib/libdav1d.so.6' | ||
if 'osx' in os.getenv('target_platform', ''): | ||
external_host_file = 'lib/libdav1d.6.dylib' | ||
if 'win' in os.getenv('target_platform', ''): | ||
external_host_file = 'Library/bin/dav1d.dll' | ||
filename = os.path.join(os.environ["PREFIX"], external_host_file) | ||
assert not os.path.isfile(filename), filename + " is missing" | ||
print("glob exclude prefix OK") | ||
|
||
filename = os.path.join(os.environ['PREFIX'], f'{file_basename}3.ext') | ||
assert not os.path.isfile(filename) | ||
print('glob exclude OK') | ||
|
||
filename = os.path.join(os.environ['PREFIX'], external_host_file) | ||
assert not os.path.isfile(filename) | ||
print('glob exclude prefix OK') | ||
|
||
print(os.getenv('PREFIX')) | ||
filename = os.path.join(os.environ['PREFIX'], f'{file_basename}1') | ||
assert os.path.isfile(filename) | ||
print(os.getenv("PREFIX")) | ||
filename = os.path.join(os.environ["PREFIX"], f"{file_basename}1") | ||
assert os.path.isfile(filename), filename + " is missing" | ||
contents = open(filename).read().rstrip() | ||
if hasattr(contents, 'decode'): | ||
if hasattr(contents, "decode"): | ||
contents = contents.decode() | ||
assert 'weee' in contents, 'incorrect file contents: %s' % contents | ||
print('plain file OK') | ||
assert "weee" in contents, "incorrect file contents: %s" % contents | ||
print("plain file OK") | ||
|
||
filename = os.path.join(os.environ['PREFIX'], 'somedir', f'{file_basename}1') | ||
assert os.path.isfile(filename), filename + ' is missing' | ||
filename = os.path.join(os.environ["PREFIX"], dirname, f"{file_basename}1") | ||
assert os.path.isfile(filename), filename + " is missing" | ||
contents = open(filename).read().rstrip() | ||
if hasattr(contents, 'decode'): | ||
if hasattr(contents, "decode"): | ||
contents = contents.decode() | ||
assert 'weee' in contents, 'incorrect file contents: %s' % contents | ||
print('subfolder file OK') | ||
assert "weee" in contents, "incorrect file contents: %s" % contents | ||
print("subfolder file OK") | ||
|
||
filename = os.path.join(os.environ['PREFIX'], f'{file_basename}1.ext') | ||
assert os.path.isfile(filename) | ||
filename = os.path.join(os.environ["PREFIX"], f"{file_basename}1.{extension}") | ||
assert os.path.isfile(filename), filename + " is missing" | ||
contents = open(filename).read().rstrip() | ||
if hasattr(contents, 'decode'): | ||
if hasattr(contents, "decode"): | ||
contents = contents.decode() | ||
assert 'weee' in contents, 'incorrect file contents: %s' % contents | ||
assert "weee" in contents, "incorrect file contents: %s" % contents | ||
|
||
filename = os.path.join(os.environ['PREFIX'], f'{file_basename}2.ext') | ||
assert os.path.isfile(filename) | ||
filename = os.path.join(os.environ["PREFIX"], f"{file_basename}2.{extension}") | ||
assert os.path.isfile(filename), filename + " is missing" | ||
contents = open(filename).read().rstrip() | ||
if hasattr(contents, 'decode'): | ||
if hasattr(contents, "decode"): | ||
contents = contents.decode() | ||
assert 'weee' in contents, 'incorrect file contents: %s' % contents | ||
print('glob OK') | ||
assert "weee" in contents, "incorrect file contents: %s" % contents | ||
print("glob OK") |