summaryrefslogtreecommitdiff
path: root/tests/sources/remote.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sources/remote.py')
-rw-r--r--tests/sources/remote.py44
1 files changed, 9 insertions, 35 deletions
diff --git a/tests/sources/remote.py b/tests/sources/remote.py
index 685f6bfba..a02601215 100644
--- a/tests/sources/remote.py
+++ b/tests/sources/remote.py
@@ -15,16 +15,12 @@ DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "remote",)
def generate_project(project_dir, tmpdir):
project_file = os.path.join(project_dir, "project.conf")
- _yaml.roundtrip_dump(
- {"name": "foo", "aliases": {"tmpdir": "file:///" + str(tmpdir)}}, project_file
- )
+ _yaml.roundtrip_dump({"name": "foo", "aliases": {"tmpdir": "file:///" + str(tmpdir)}}, project_file)
def generate_project_file_server(server, project_dir):
project_file = os.path.join(project_dir, "project.conf")
- _yaml.roundtrip_dump(
- {"name": "foo", "aliases": {"tmpdir": server.base_url()}}, project_file
- )
+ _yaml.roundtrip_dump({"name": "foo", "aliases": {"tmpdir": server.base_url()}}, project_file)
# Test that without ref, consistency is set appropriately.
@@ -74,10 +70,7 @@ def test_simple_file_build(cli, tmpdir, datafiles):
result = cli.run(project=project, args=["build", "target.bst"])
result.assert_success()
- result = cli.run(
- project=project,
- args=["artifact", "checkout", "target.bst", "--directory", checkoutdir],
- )
+ result = cli.run(project=project, args=["artifact", "checkout", "target.bst", "--directory", checkoutdir],)
result.assert_success()
# Note that the url of the file in target.bst is actually /dir/file
# but this tests confirms we take the basename
@@ -104,10 +97,7 @@ def test_simple_file_custom_name_build(cli, tmpdir, datafiles):
result = cli.run(project=project, args=["build", "target.bst"])
result.assert_success()
- result = cli.run(
- project=project,
- args=["artifact", "checkout", "target.bst", "--directory", checkoutdir],
- )
+ result = cli.run(project=project, args=["artifact", "checkout", "target.bst", "--directory", checkoutdir],)
result.assert_success()
assert not os.path.exists(os.path.join(checkoutdir, "file"))
assert os.path.exists(os.path.join(checkoutdir, "custom-file"))
@@ -120,9 +110,7 @@ def test_unique_key(cli, tmpdir, datafiles):
"""
project = str(datafiles)
generate_project(project, tmpdir)
- states = cli.get_element_states(
- project, ["target.bst", "target-custom.bst", "target-custom-executable.bst"]
- )
+ states = cli.get_element_states(project, ["target.bst", "target-custom.bst", "target-custom-executable.bst"])
assert states["target.bst"] == "fetch needed"
assert states["target-custom.bst"] == "fetch needed"
assert states["target-custom-executable.bst"] == "fetch needed"
@@ -131,9 +119,7 @@ def test_unique_key(cli, tmpdir, datafiles):
cli.run(project=project, args=["source", "fetch", "target.bst"])
# We should download the file only once
- states = cli.get_element_states(
- project, ["target.bst", "target-custom.bst", "target-custom-executable.bst"]
- )
+ states = cli.get_element_states(project, ["target.bst", "target-custom.bst", "target-custom-executable.bst"])
assert states["target.bst"] == "buildable"
assert states["target-custom.bst"] == "buildable"
assert states["target-custom-executable.bst"] == "buildable"
@@ -153,21 +139,12 @@ def test_executable(cli, tmpdir, datafiles):
project = str(datafiles)
generate_project(project, tmpdir)
checkoutdir = os.path.join(str(tmpdir), "checkout")
- assert (
- cli.get_element_state(project, "target-custom-executable.bst") == "fetch needed"
- )
+ assert cli.get_element_state(project, "target-custom-executable.bst") == "fetch needed"
# Try to fetch it
cli.run(project=project, args=["build", "target-custom-executable.bst"])
cli.run(
- project=project,
- args=[
- "artifact",
- "checkout",
- "target-custom-executable.bst",
- "--directory",
- checkoutdir,
- ],
+ project=project, args=["artifact", "checkout", "target-custom-executable.bst", "--directory", checkoutdir,],
)
mode = os.stat(os.path.join(checkoutdir, "some-custom-file")).st_mode
assert mode & stat.S_IEXEC
@@ -200,10 +177,7 @@ def test_use_netrc(cli, datafiles, server_type, tmpdir):
result.assert_success()
result = cli.run(project=project, args=["build", "target.bst"])
result.assert_success()
- result = cli.run(
- project=project,
- args=["artifact", "checkout", "target.bst", "--directory", checkoutdir],
- )
+ result = cli.run(project=project, args=["artifact", "checkout", "target.bst", "--directory", checkoutdir],)
result.assert_success()
checkout_file = os.path.join(checkoutdir, "file")