# Path: grafana_dashboards/client/connection.py
# class KerberosConnection(object):
#     def __init__(self, host):
#         logger.debug('Creating new kerberos connection with host=%s', host)
#         self._host = host
# 
#     def make_request(self, uri, body=None):
#         response = requests.post('{0}{1}'.format(self._host, uri), json=body, auth=HTTPKerberosAuth(), verify=False)
#         return response.json()
# 
# class BasicAuthConnection(BaseConnection):
#     def __init__(self, username, password, host, debug=0):
#         logger.debug('Creating new connection with username=%s host=%s', username, host)
# 
#         base64string = base64.encodestring(('%s:%s' % (username, password)).encode('utf-8')).replace(b'\n', b'')
# 
#         super(BasicAuthConnection, self).__init__(host, b'Basic ' + base64string, debug)
# 
# class BearerAuthConnection(BaseConnection):
#     def __init__(self, token, host, debug=0):
#         logger.debug('Creating new connection with token=%s host=%s', token[:5], host)
# 
#         super(BearerAuthConnection, self).__init__(host, 'Bearer %s' % token.strip(), debug)


    from urllib2 import Request
    from urllib.request import Request
from mock import MagicMock, patch
from requests_kerberos import HTTPKerberosAuth
from grafana_dashboards.client.connection import KerberosConnection, BasicAuthConnection, BearerAuthConnection
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import unicode_literals
try:
except ImportError:


__author__ = 'Jakub Plichta <jakub.plichta@gmail.com>'


class Capture(object):
    """
    Class for use in method call verification that captures call argument that can be tested later on.
    """

    def __eq__(self, other):
        """
        Captures argument and always returns true to make verification successful.
        :return: True
        """
        self.value = other
        return True


def test_connection():

# Path: grafana_dashboards/client/connection.py
# class KerberosConnection(object):
#     def __init__(self, host):
#         logger.debug('Creating new kerberos connection with host=%s', host)
#         self._host = host
# 
#     def make_request(self, uri, body=None):
#         response = requests.post('{0}{1}'.format(self._host, uri), json=body, auth=HTTPKerberosAuth(), verify=False)
#         return response.json()
# 
# class BasicAuthConnection(BaseConnection):
#     def __init__(self, username, password, host, debug=0):
#         logger.debug('Creating new connection with username=%s host=%s', username, host)
# 
#         base64string = base64.encodestring(('%s:%s' % (username, password)).encode('utf-8')).replace(b'\n', b'')
# 
#         super(BasicAuthConnection, self).__init__(host, b'Basic ' + base64string, debug)
# 
# class BearerAuthConnection(BaseConnection):
#     def __init__(self, token, host, debug=0):
#         logger.debug('Creating new connection with token=%s host=%s', token[:5], host)
# 
#         super(BearerAuthConnection, self).__init__(host, 'Bearer %s' % token.strip(), debug)


# Path: tests/grafana_dashboards/client/test_connection.py
    from urllib2 import Request
    from urllib.request import Request
from mock import MagicMock, patch
from requests_kerberos import HTTPKerberosAuth
from grafana_dashboards.client.connection import KerberosConnection, BasicAuthConnection, BearerAuthConnection

# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import unicode_literals
try:
except ImportError:


__author__ = 'Jakub Plichta <jakub.plichta@gmail.com>'


class Capture(object):
    """
    Class for use in method call verification that captures call argument that can be tested later on.
    """

    def __eq__(self, other):
        """
        Captures argument and always returns true to make verification successful.
        :return: True
        """
        self.value = other
        return True


def test_connection():

    connection = BasicAuthConnection('username', 'password', 'https://host')