# Path: twitch/api/base.py
# DEFAULT_TIMEOUT = 10
# class TwitchAPI(object):
#     def __init__(self, client_id, oauth_token=None):
#     def _get_request_headers(self):
#     def _request_get(self, path, params=None, json=True, url=BASE_URL):
#     def _request_post(self, path, data=None, params=None, url=BASE_URL):
#     def _request_put(self, path, data=None, params=None, url=BASE_URL):
#     def _request_delete(self, path, params=None, url=BASE_URL):


import json
import os
import pytest
import responses
from requests import exceptions
from twitch.api.base import BASE_URL, TwitchAPI


def test_get_request_headers_include_version_and_client_id():
    client_id = "abcd"
    api = TwitchAPI(client_id=client_id)

    headers = api._get_request_headers()

    assert len(headers) == 2
    assert headers["Accept"] == "application/vnd.twitchtv.v5+json"
    assert headers["Client-ID"] == client_id


def test_get_request_headers_includes_authorization():
    client_id = "client"
    oauth_token = "token"
    api = TwitchAPI(client_id=client_id, oauth_token=oauth_token)

    headers = api._get_request_headers()

    assert len(headers) == 3
    assert headers["Accept"] == "application/vnd.twitchtv.v5+json"
    assert headers["Client-ID"] == client_id
    assert headers["Authorization"] == "OAuth {}".format(oauth_token)


@responses.activate
def test_request_get_returns_dictionary_if_successful():
    responses.add(
        responses.GET,

# Path: twitch/api/base.py
# DEFAULT_TIMEOUT = 10
# class TwitchAPI(object):
#     def __init__(self, client_id, oauth_token=None):
#     def _get_request_headers(self):
#     def _request_get(self, path, params=None, json=True, url=BASE_URL):
#     def _request_post(self, path, data=None, params=None, url=BASE_URL):
#     def _request_put(self, path, data=None, params=None, url=BASE_URL):
#     def _request_delete(self, path, params=None, url=BASE_URL):


# Path: tests/api/test_base.py
import json
import os
import pytest
import responses
from requests import exceptions
from twitch.api.base import BASE_URL, TwitchAPI



def test_get_request_headers_include_version_and_client_id():
    client_id = "abcd"
    api = TwitchAPI(client_id=client_id)

    headers = api._get_request_headers()

    assert len(headers) == 2
    assert headers["Accept"] == "application/vnd.twitchtv.v5+json"
    assert headers["Client-ID"] == client_id


def test_get_request_headers_includes_authorization():
    client_id = "client"
    oauth_token = "token"
    api = TwitchAPI(client_id=client_id, oauth_token=oauth_token)

    headers = api._get_request_headers()

    assert len(headers) == 3
    assert headers["Accept"] == "application/vnd.twitchtv.v5+json"
    assert headers["Client-ID"] == client_id
    assert headers["Authorization"] == "OAuth {}".format(oauth_token)


@responses.activate
def test_request_get_returns_dictionary_if_successful():
    responses.add(
        responses.GET,

        BASE_URL,