haystack/test/test_ui_utils.py
Fabrice Depaulis 77d52ad215
Rely api healthcheck on status code rather than json decoding (#1871)
* Rely api healthcheck on status code rather than json decoding

* Install UI dependencies on the Linux and Windows CI

Co-authored-by: Fabrice Depaulis <fabrice.depaulis@orange.com>
Co-authored-by: ZanSara <sarazanzo94@gmail.com>
2021-12-10 18:05:23 +01:00

16 lines
418 B
Python

from unittest.mock import MagicMock, patch
from ui.utils import haystack_is_ready
def test_haystack_is_ready():
with patch('requests.get') as mocked_get:
mocked_get.return_value.status_code = 200
assert haystack_is_ready()
def test_haystack_is_ready_fail():
with patch('requests.get') as mocked_get:
mocked_get.return_value.status_code = 400
assert not haystack_is_ready()