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

from datetime import datetime
import os

from eventbrite import Eventbrite

from ..base import unittest

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

try:
    USER_ID = os.environ[u'EVENTBRITE_USER_ID']
    skip_user_id_tests = False
except KeyError:
    skip_user_id_tests = True


class TestEvents(unittest.TestCase):

    def setUp(self):
        self.eventbrite = Eventbrite(OAUTH_TOKEN)

    @unittest.skipIf(condition=skip_user_id_tests, reason='Needs a USER_ID')
    @unittest.skipIf(
        condition=skip_integration_tests,
        reason='Needs an OAUTH_TOKEN')
    def test_post_event(self):

        event_name = 'client_test_{0}'.format(datetime.now())

        event_data = {
            'event.name': {
                'html': event_name,
            },
            'event.start': {
                'utc': '2015-03-07T20:00:00Z',
                'timezone': 'America/Los_Angeles',
            },
            'event.end': {
                'utc': '2015-03-07T23:00:00Z',
                'timezone': 'America/Los_Angeles',
            },
            'event.currency': 'USD',
            'event.online_event': True,
            'event.listed': False,
            'event.category_id': '110',
            'event.format_id': '5',
            'event.password': "<PASSWORD>",
            'event.capacity': 10,
        }
        event = self.eventbrite.post('/events/', data=event_data)
        self.assertEqual(event_name, event['name']['text'])<commit_msg>testing post_event method instead of bypassing post_event method<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from datetime import datetime
import os

from eventbrite import Eventbrite

from ..base import unittest

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

try:
    USER_ID = os.environ[u'EVENTBRITE_USER_ID']
    skip_user_id_tests = False
except KeyError:
    skip_user_id_tests = True


class TestEvents(unittest.TestCase):

    def setUp(self):
        self.eventbrite = Eventbrite(OAUTH_TOKEN)

    @unittest.skipIf(condition=skip_user_id_tests, reason='Needs a USER_ID')
    @unittest.skipIf(
        condition=skip_integration_tests,
        reason='Needs an OAUTH_TOKEN')
    def test_post_event(self):

        event_name = 'client_test_{0}'.format(datetime.now())

        event_data = {
            'event.name': {
                'html': event_name,
            },
            'event.start': {
                'utc': '2015-03-07T20:00:00Z',
                'timezone': 'America/Los_Angeles',
            },
            'event.end': {
                'utc': '2015-03-07T23:00:00Z',
                'timezone': 'America/Los_Angeles',
            },
            'event.currency': 'USD',
            'event.online_event': True,
            'event.listed': False,
            'event.category_id': '110',
            'event.format_id': '5',
            'event.password': "<PASSWORD>",
            'event.capacity': 10,
        }
        event = self.eventbrite.post_event(event_data)
        self.assertEqual(event_name, event['name']['text'])
{'fraction_non_alphanumeric': 0.12366863905325444, 'fraction_numerical': 0.021301775147928994, 'mean_word_length': 2.350842418235877, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '4418935', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1061, 'n_words': 189}