<commit_before>import conjur
from mock import patch, Mock
import requests

@patch.object(requests, 'post')
def test_authenticate(mock_post):
    api = conjur.new_from_key("login", "api-key")
    api.config.authn_url = "https://example.com"
    mock_post.return_value = mock_response = Mock()
    mock_response.status_code = 200
    mock_response.text = "token token token"
    token = api.authenticate()
    assert token == "token token token"
    mock_post.assert_called_with("https://example.com/users/login/authenticate", "api-key")<commit_msg>add another test case<commit_after>import conjur
from mock import patch, Mock
import requests

@patch.object(requests, 'post')
def test_authenticate(mock_post):
    api = conjur.new_from_key("login", "api-key")
    api.config.authn_url = "https://example.com"
    mock_post.return_value = mock_response = Mock()
    mock_response.status_code = 200
    mock_response.text = "token token token"
    token = api.authenticate()
    assert token == "token token token"
    mock_post.assert_called_with("https://example.com/users/login/authenticate", "api-key")

@patch.object(requests, 'post')
def test_authenticate_with_cached_token(mock_post):
    api = conjur.new_from_token("token token")
    assert api.authenticate() == "token token"
    mock_post.assert_not_called()
{'fraction_non_alphanumeric': 0.12319391634980989, 'fraction_numerical': 0.0045627376425855515, 'mean_word_length': 4.797356828193832, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7612596', 'n_tokens_mistral': 430, 'n_tokens_neox': 415, 'n_words': 86}