<commit_before>import sys
import mock
try:
    import unittest2
except ImportError:
    if sys.version_info < (2, 7):
        raise
    import unittest as unittest2

# from restkit import Resource
from restkit.wrappers import Response
from BaruwaAPI.endpoints import ENDPOINTS
from BaruwaAPI.resource import BaruwaAPIClient
from BaruwaAPI.exceptions import BaruwaAPIError

API_URL = 'https://baruwa.example.com'
API_TOKEN = '<KEY>'


class BaruwaAPIClientTestCase(unittest2.TestCase):

    def setUp(self):
        """Setup API"""
        self.mock_request = mock.MagicMock()
        self.mock_response = mock.Mock(spec=Response)
        self.api = BaruwaAPIClient(API_TOKEN, API_URL)

    def test_headers(self):
        headers = self.api._request_headers()
        self.assertIn('User-Agent', headers)
        self.assertIn('Content-Type', headers)
        self.assertIn('Authorization', headers)
        self.assertEqual(headers['Authorization'], "Bearer %s" % API_TOKEN)

    def test_request_ok(self):<commit_msg>* Cleanup<commit_after>import sys
import mock
try:
    import unittest2
except ImportError:
    if sys.version_info < (2, 7):
        raise
    import unittest as unittest2

from restkit.wrappers import Response
from BaruwaAPI.endpoints import ENDPOINTS
from BaruwaAPI.resource import BaruwaAPIClient
from BaruwaAPI.exceptions import BaruwaAPIError

API_URL = 'https://baruwa.example.com'
API_TOKEN = '<KEY>'


class BaruwaAPIClientTestCase(unittest2.TestCase):

    def setUp(self):
        """Setup API"""
        self.mock_request = mock.MagicMock()
        self.mock_response = mock.Mock(spec=Response)
        self.api = BaruwaAPIClient(API_TOKEN, API_URL)

    def test_headers(self):
        headers = self.api._request_headers()
        self.assertIn('User-Agent', headers)
        self.assertIn('Content-Type', headers)
        self.assertIn('Authorization', headers)
        self.assertEqual(headers['Authorization'], "Bearer %s" % API_TOKEN)

    def test_request_ok(self):
{'fraction_non_alphanumeric': 0.10084872690963555, 'fraction_numerical': 0.004992511233150275, 'mean_word_length': 3.7375886524822697, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '5080973', 'n_tokens_mistral': 622, 'n_tokens_neox': 633, 'n_words': 138}