mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-08 15:28:26 +01:00
💅 black
This commit is contained in:
+3
-3
@@ -32,7 +32,7 @@ SUMMON_SCHEMA = Schema(
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ def summon(name, repo=None, rev=None, summon_file="dvcsummon.yaml", args=None):
|
||||
except SummonError as exc:
|
||||
raise SummonError(
|
||||
str(exc) + " at '{}' in '{}'".format(summon_file, repo),
|
||||
cause=exc.cause
|
||||
cause=exc.cause,
|
||||
)
|
||||
|
||||
_pull_dependencies(_repo, info.get("deps"))
|
||||
@@ -132,7 +132,7 @@ def _get_object_from_summon_file(name, path):
|
||||
elif len(objects) >= 2:
|
||||
raise SummonError(
|
||||
"More than one object with name '{}'".format(name)
|
||||
)
|
||||
)
|
||||
|
||||
return objects[0]
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ def test_summon(tmp_dir, erepo_dir, dvc, monkeypatch):
|
||||
"objects": [
|
||||
{
|
||||
"name": "sum",
|
||||
"meta": { "description": "Add <x> to <number>" },
|
||||
"meta": {"description": "Add <x> to <number>"},
|
||||
"summon": {
|
||||
"type": "python",
|
||||
"call": "calculator.add_to_num",
|
||||
@@ -151,7 +151,7 @@ def test_summon(tmp_dir, erepo_dir, dvc, monkeypatch):
|
||||
different_objects = copy.deepcopy(objects)
|
||||
different_objects["objects"][0]["summon"]["args"]["x"] = 100
|
||||
|
||||
dup_objects= copy.deepcopy(objects)
|
||||
dup_objects = copy.deepcopy(objects)
|
||||
dup_objects["objects"] *= 2
|
||||
|
||||
dvcsummon_yaml = ruamel.yaml.dump(objects)
|
||||
@@ -179,7 +179,9 @@ def test_summon(tmp_dir, erepo_dir, dvc, monkeypatch):
|
||||
|
||||
assert api.summon("sum", repo=repo_url) == 101
|
||||
assert api.summon("sum", repo=repo_url, args={"x": 2}) == 102
|
||||
assert api.summon("sum", repo=repo_url, summon_file="different.yaml") == 200
|
||||
assert (
|
||||
api.summon("sum", repo=repo_url, summon_file="different.yaml") == 200
|
||||
)
|
||||
|
||||
try:
|
||||
api.summon("sum", repo=repo_url, summon_file="missing.yaml")
|
||||
@@ -193,7 +195,9 @@ def test_summon(tmp_dir, erepo_dir, dvc, monkeypatch):
|
||||
with pytest.raises(SummonError, match=r"No object with name 'missing'"):
|
||||
api.summon("missing", repo=repo_url)
|
||||
|
||||
with pytest.raises(SummonError, match=r"More than one object with name 'sum'"):
|
||||
with pytest.raises(
|
||||
SummonError, match=r"More than one object with name 'sum'"
|
||||
):
|
||||
api.summon("sum", repo=repo_url, summon_file="dup.yaml")
|
||||
|
||||
with pytest.raises(SummonError, match=r"extra keys not allowed"):
|
||||
|
||||
Reference in New Issue
Block a user