# Path: github2/request.py
# DEFAULT_GITHUB_URL = "https://github.com"
# LOGGER = logging.getLogger('github2.request')
# _HTTPLIB2_BUNDLE = path.realpath(path.dirname(httplib2.CA_CERTS))
# SYSTEM_CERTS = not _HTTPLIB2_BUNDLE.startswith(path.dirname(httplib2.__file__))
# CA_CERTS = None
# CURL_CERTS = False
#             CA_CERTS = cert_file
#             SYSTEM_CERTS = True
#         CA_CERTS = '/usr/local/share/certs/ca-root-nss.crt'
#         SYSTEM_CERTS = True
#     CA_CERTS = getenv('CURL_CA_BUNDLE')
#     CURL_CERTS = True
#     CA_CERTS = path.join(path.dirname(path.abspath(__file__)),
#                          "DigiCert_High_Assurance_EV_Root_CA.crt")
# def charset_from_headers(headers):
#     def __init__(self, message, content, code):
#     def __init__(self, username=None, api_token=None, url_prefix=None,
#                  requests_per_second=None, access_token=None,
#                  cache=None, proxy_host=None, proxy_port=None,
#                  github_url=None):
#     def encode_authentication_data(self, extra_post_data):
#     def get(self, *path_components):
#     def post(self, *path_components, **extra_post_data):
#     def put(self, *path_components, **extra_post_data):
#     def delete(self, *path_components, **extra_post_data):
#     def make_request(self, path, extra_post_data=None, method="GET"):
#     def raw_request(self, url, extra_post_data, method="GET"):
#     def http_headers(self):
# class GithubError(Exception):
# class HttpError(RuntimeError):
# class GithubRequest(object):


import unittest
    import unittest2
    from urllib.parse import parse_qs  # For Python 3
        from urlparse import parse_qs  # NOQA
        from cgi import parse_qs  # NOQA
    from nose.tools import (assert_dict_contains_subset, assert_dict_equal)
from github2 import request
# Copyright (C) 2011-2012 James Rowe <jnrowe@gmail.com>
#
# This file is part of python-github2, and is made available under the 3-clause
# BSD license.  See LICENSE for the full details.


try:
except ImportError:
    try:
    except ImportError:  # For Python <2.6

try:
except ImportError:  # for Python <2.7

    _binding = unittest2.TestCase('run')
    assert_dict_contains_subset = _binding.assertDictContainsSubset  # NOQA
    assert_dict_equal = _binding.assertDictEqual  # NOQA




def assert_params(first, second):
    assert_dict_equal(first, parse_qs(second))


def assert_params_contain(first, second):
    assert_dict_contains_subset(first, parse_qs(second))



# Path: github2/request.py
# DEFAULT_GITHUB_URL = "https://github.com"
# LOGGER = logging.getLogger('github2.request')
# _HTTPLIB2_BUNDLE = path.realpath(path.dirname(httplib2.CA_CERTS))
# SYSTEM_CERTS = not _HTTPLIB2_BUNDLE.startswith(path.dirname(httplib2.__file__))
# CA_CERTS = None
# CURL_CERTS = False
#             CA_CERTS = cert_file
#             SYSTEM_CERTS = True
#         CA_CERTS = '/usr/local/share/certs/ca-root-nss.crt'
#         SYSTEM_CERTS = True
#     CA_CERTS = getenv('CURL_CA_BUNDLE')
#     CURL_CERTS = True
#     CA_CERTS = path.join(path.dirname(path.abspath(__file__)),
#                          "DigiCert_High_Assurance_EV_Root_CA.crt")
# def charset_from_headers(headers):
#     def __init__(self, message, content, code):
#     def __init__(self, username=None, api_token=None, url_prefix=None,
#                  requests_per_second=None, access_token=None,
#                  cache=None, proxy_host=None, proxy_port=None,
#                  github_url=None):
#     def encode_authentication_data(self, extra_post_data):
#     def get(self, *path_components):
#     def post(self, *path_components, **extra_post_data):
#     def put(self, *path_components, **extra_post_data):
#     def delete(self, *path_components, **extra_post_data):
#     def make_request(self, path, extra_post_data=None, method="GET"):
#     def raw_request(self, url, extra_post_data, method="GET"):
#     def http_headers(self):
# class GithubError(Exception):
# class HttpError(RuntimeError):
# class GithubRequest(object):


# Path: tests/test_request.py
import unittest
    import unittest2
    from urllib.parse import parse_qs  # For Python 3
        from urlparse import parse_qs  # NOQA
        from cgi import parse_qs  # NOQA
    from nose.tools import (assert_dict_contains_subset, assert_dict_equal)
from github2 import request

# Copyright (C) 2011-2012 James Rowe <jnrowe@gmail.com>
#
# This file is part of python-github2, and is made available under the 3-clause
# BSD license.  See LICENSE for the full details.


try:
except ImportError:
    try:
    except ImportError:  # For Python <2.6

try:
except ImportError:  # for Python <2.7

    _binding = unittest2.TestCase('run')
    assert_dict_contains_subset = _binding.assertDictContainsSubset  # NOQA
    assert_dict_equal = _binding.assertDictEqual  # NOQA




def assert_params(first, second):
    assert_dict_equal(first, parse_qs(second))


def assert_params_contain(first, second):
    assert_dict_contains_subset(first, parse_qs(second))



class TestAuthEncode(unittest.TestCase):