def test_get_providers(config, req_mock):
resp = create_autospec(requests.Response)
resp.return_value = {}
req_mock.return_value = resp
config.return_value = "http://localhost"
auth.get_providers()
req_mock.assert_called_with(
"http://localhost/acs/api/v1/auth/providers")
# test url construction valid with trailing slash
config.return_value = "http://localhost/"
auth.get_providers()
req_mock.assert_called_with(
"http://localhost/acs/api/v1/auth/providers")
评论列表
文章目录