Skip to content

Commit

Permalink
Tests: Don't test for semi-hard-coded paths
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Bargull <[email protected]>
  • Loading branch information
mbargull committed Nov 10, 2023
1 parent 55b73a7 commit 6456400
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
12 changes: 4 additions & 8 deletions tests/cli/test_main_metapackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def test_metapackage(testing_config, testing_workdir):
main_metapackage.execute(args)
test_path = glob(
os.path.join(
sys.prefix,
"conda-bld",
testing_config.croot,
testing_config.host_subdir,
"metapackage_test-1.0-0.tar.bz2",
)
Expand All @@ -38,8 +37,7 @@ def test_metapackage_build_number(testing_config, testing_workdir):
main_metapackage.execute(args)
test_path = glob(
os.path.join(
sys.prefix,
"conda-bld",
testing_config.croot,
testing_config.host_subdir,
"metapackage_test_build_number-1.0-1.tar.bz2",
)
Expand All @@ -61,8 +59,7 @@ def test_metapackage_build_string(testing_config, testing_workdir):
main_metapackage.execute(args)
test_path = glob(
os.path.join(
sys.prefix,
"conda-bld",
testing_config.croot,
testing_config.host_subdir,
"metapackage_test_build_string-1.0-frank*.tar.bz2",
)
Expand All @@ -88,8 +85,7 @@ def test_metapackage_metadata(testing_config, testing_workdir):

test_path = glob(
os.path.join(
sys.prefix,
"conda-bld",
testing_config.croot,
testing_config.host_subdir,
"metapackage_testing_metadata-1.0-0.tar.bz2",
)
Expand Down
10 changes: 4 additions & 6 deletions tests/cli/test_main_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,12 @@ def test_render_without_channel_fails(tmp_path):
), f"Expected to get only base package name because it should not be found, but got :{required_package_string}"


def test_render_output_build_path(testing_workdir, testing_metadata, capfd, caplog):
def test_render_output_build_path(testing_workdir, testing_config, testing_metadata, capfd, caplog):
api.output_yaml(testing_metadata, "meta.yaml")
args = ["--output", testing_workdir]
main_render.execute(args)
test_path = os.path.join(
sys.prefix,
"conda-bld",
testing_config.croot,
testing_metadata.config.host_subdir,
"test_render_output_build_path-1.0-1.tar.bz2",
)
Expand All @@ -82,15 +81,14 @@ def test_render_output_build_path(testing_workdir, testing_metadata, capfd, capl


def test_render_output_build_path_and_file(
testing_workdir, testing_metadata, capfd, caplog
testing_workdir, testing_config, testing_metadata, capfd, caplog
):
api.output_yaml(testing_metadata, "meta.yaml")
rendered_filename = "out.yaml"
args = ["--output", "--file", rendered_filename, testing_workdir]
main_render.execute(args)
test_path = os.path.join(
sys.prefix,
"conda-bld",
testing_config.croot,
testing_metadata.config.host_subdir,
"test_render_output_build_path_and_file-1.0-1.tar.bz2",
)
Expand Down

0 comments on commit 6456400

Please sign in to comment.