def test_sink_orion_status(requests_mock): sink = SinkOrion() requests_mock.get("http://127.0.0.1:1026/version", json={'orion': { 'version': '2.2.0-next' }}) status = sink.status() assert status["orion"]["version"] == "2.2.0-next"
def test_sink_orion_status_with_auth(requests_mock): sink = SinkOrion(token="00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff") requests_mock.get("http://127.0.0.1:1026/version", request_headers={ 'X-Auth-Token': '00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff' }, json={'orion': { 'version': '2.2.0-next' }}) status = sink.status() assert status["orion"]["version"] == "2.2.0-next"
def test_sink_orion_status_with_auth_env(mocker, requests_mock): mocker.patch.dict( os.environ, {'ORION_TOKEN': '00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff'}) sink = SinkOrion() requests_mock.get("http://127.0.0.1:1026/version", request_headers={ 'X-Auth-Token': '00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff' }, json={'orion': { 'version': '2.2.0-next' }}) status = sink.status() assert status["orion"]["version"] == "2.2.0-next"