def test_post_passwordcheck(mock_requests, mock_info):
    mock_requests.post.return_value.status_code = 200
    api = PublicAPI(TOKEN)
    api.post_passwordcheck(
        password = "******")
    mock_requests.post.assert_called_once_with(
        'https://connectapi.feuersoftware.com/interfaces/public/passwordcheck',
        data='{"password": "******"}',
        headers={"authorization": f"bearer {TOKEN}",
        "accept": "application/json",
        "content-type": "application/json"})
    mock_info.assert_called_with("Success, API call 'post passwordcheck' complete")
def test_error_get_geocoding(mock_requests, mock_error):
    mock_requests.post.return_value.status_code = 401
    mock_requests.post.return_value.text = "unauthorized"
    api = PublicAPI("ABCD")
    api.post_passwordcheck(
        password = "******")
    mock_requests.post.assert_called_once_with(
        'https://connectapi.feuersoftware.com/interfaces/public/passwordcheck',
        data='{"password": "******"}',
        headers={"authorization": f"bearer ABCD",
        "accept": "application/json",
        "content-type": "application/json"})
    mock_error.assert_called_with("Error while sending API call 'post passwordcheck': 401 unauthorized")
Exemple #3
0
def test_post_passwordcheck(mock_requests, mock_info):
    mock_requests.post.return_value.status_code = 200
    api = PublicAPI(TOKEN)
    api.post_passwordcheck(password="******")
    mock_requests.post.assert_called_once_with(
        'https://connectapi.feuersoftware.com/interfaces/public/passwordcheck',
        data='{"password": "******"}',
        headers={
            "authorization": f"bearer {TOKEN}",
            "accept": "application/json",
            "content-type": "application/json"
        })
    mock_info.assert_called_with(
        "Success, API call 'post passwordcheck' complete")
Exemple #4
0
def test_error_get_geocoding(mock_requests, mock_error):
    mock_requests.post.return_value.status_code = 401
    mock_requests.post.return_value.text = "unauthorized"
    api = PublicAPI("ABCD")
    api.post_passwordcheck(password="******")
    mock_requests.post.assert_called_once_with(
        'https://connectapi.feuersoftware.com/interfaces/public/passwordcheck',
        data='{"password": "******"}',
        headers={
            "authorization": f"bearer ABCD",
            "accept": "application/json",
            "content-type": "application/json"
        })
    mock_error.assert_called_with(
        "Error while sending API call 'post passwordcheck': 401 unauthorized")