<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from datetime import timedelta
import os

from requests.structures import CaseInsensitiveDict

from eventbrite import Eventbrite

from ..base import unittest

try:
    oauth_token = os.environ.get(u'OAUTH_TOKEN')
    skip_integration_tests = False
except KeyError:
    skip_integration_tests = True


class TestClient(unittest.TestCase):

    @unittest.skipIf(condition=skip_integration_tests, reason='Needs an OAUTH_TOKEN')
    def test_user_me(self):
        eventbrite = Eventbrite(oauth_token)

        payload = eventbrite.api("get", "/users/me/", {})

        self.assertEqual(
            sorted([u'id', u'first_name', u'last_name', u'emails', u'name']),
            sorted(payload.keys())
        )

        self.assertEqual(
            payload.url,
            "https://www.eventbriteapi.com/v3/users/me/"
        )

        self.assertTrue(payload.ok)
        self.assertTrue(isinstance(payload.elapsed, timedelta))
        self.assertTrue(isinstance(payload.headers, CaseInsensitiveDict))


if __name__ == '__main__':<commit_msg>corrected os.environ call<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from datetime import timedelta
import os

from requests.structures import CaseInsensitiveDict

from eventbrite import Eventbrite

from ..base import unittest

try:
    oauth_token = os.environ[u'OAUTH_TOKEN']
    skip_integration_tests = False
except KeyError:
    skip_integration_tests = True


class TestClient(unittest.TestCase):

    @unittest.skipIf(condition=skip_integration_tests, reason='Needs an OAUTH_TOKEN')
    def test_user_me(self):
        eventbrite = Eventbrite(oauth_token)

        payload = eventbrite.api("get", "/users/me/", {})

        self.assertEqual(
            sorted([u'id', u'first_name', u'last_name', u'emails', u'name']),
            sorted(payload.keys())
        )

        self.assertEqual(
            payload.url,
            "https://www.eventbriteapi.com/v3/users/me/"
        )

        self.assertTrue(payload.ok)
        self.assertTrue(isinstance(payload.elapsed, timedelta))
        self.assertTrue(isinstance(payload.headers, CaseInsensitiveDict))


if __name__ == '__main__':
{'fraction_non_alphanumeric': 0.11421098517872712, 'fraction_numerical': 0.0017436791630340018, 'mean_word_length': 3.2578849721706864, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4418934', 'n_tokens_mistral': 723, 'n_tokens_neox': 709, 'n_words': 133}