Skip to content

Commit 2f992c8

Browse files
author
Henrique Tolentino
committed
Update workflow tests
1 parent c0f8475 commit 2f992c8

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

test_config_templates.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,21 @@ def project() -> Project:
3838
)
3939
def test_configs(_config_file, project: Project):
4040
_config_dict = yaml.safe_load(open(_config_file).read())
41-
resp = requests.post(
42-
f"{_cloud_url}/projects/{project.name}/models",
43-
json=_config_dict,
44-
params={"dry_run": "yes"},
45-
headers={"Authorization": _api_key},
46-
)
41+
print(f"Config version: {_config_dict.get('version')}")
42+
43+
if _config_dict.get("version") == "2":
44+
resp = requests.post(
45+
f"{_cloud_url}/v2/workflows/validate",
46+
json=_config_dict,
47+
headers={"Authorization": _api_key},
48+
)
49+
else:
50+
resp = requests.post(
51+
f"{_cloud_url}/projects/{project.name}/models",
52+
json=_config_dict,
53+
params={"dry_run": "yes"},
54+
headers={"Authorization": _api_key},
55+
)
4756
if resp.status_code != 200:
4857
print(f"Error for {_cloud_url}, got response: {resp.text}")
4958
assert resp.status_code == 200

0 commit comments

Comments
 (0)