Files
dvc/tests/unit/repo/experiments/test_push.py
T
skshetry 58029e9719 exp push: push experiments revs to studio (#9160)
* exp push: push experiments revs to studio

* log json data that is sent
2023-03-16 11:24:50 +05:45

28 lines
759 B
Python

from requests import Response
from dvc.repo.experiments.push import STUDIO_ENDPOINT, _notify_studio
def test_notify_studio_for_exp_push(mocker):
valid_response = Response()
valid_response.status_code = 200
mock_post = mocker.patch("requests.Session.post", return_value=valid_response)
_notify_studio(
["ref1", "ref2", "ref3"],
"[email protected]:iterative/dvc.git",
"TOKEN",
)
assert mock_post.called
assert mock_post.call_args == mocker.call(
STUDIO_ENDPOINT,
json={
"repo_url": "[email protected]:iterative/dvc.git",
"client": "dvc",
"refs": ["ref1", "ref2", "ref3"],
},
headers={"Authorization": "token TOKEN"},
timeout=5,
)