# Path: blackbelt/config.py

# 
# Path: blackbelt/circle.py
# class Client(object):
# 
#     def __init__(self, token=None):
#         if not token:
#             token = config['circleci']['access_token']
# 
#         if not token:
#             raise ValueError("Can't do things with CircleCI without access token. Run bb init.")
# 
#         self.token = token
# 
#         self.default_headers = {
#             'Accept': 'application/json',
#             'Content-Type': 'application/json'
#         }
# 
#         self.endpoint = 'https://circleci.com/api/v1'
# 
#     def get_url(self, url, **kwargs):
#         kwargs['token'] = self.token
# 
#         url = self.endpoint + url + '?circle-token={token}'
#         return url.format(**kwargs)
# 
#     def request(self, method, url, data=None):
#         res = getattr(requests, method)(url, headers=self.default_headers)
#         if not res.ok:
#             raise ValueError("Request to URL %s failed" % url)
# 
#         return res.json()
# 
#     def get_builds(self, username, project):
#         url = self.get_url(
#             '/project/{username}/{project}',
#             username=username,
#             project=project
#         )
# 
#         return self.request('get', url)
# 
#     def get_build(self, username, project, number):
#         url = self.get_url(
#             '/project/{username}/{project}/{number}',
#             username=username,
#             project=project,
#             number=number
#         )
# 
#         return self.request('get', url)


from nose.plugins.skip import SkipTest
from blackbelt.config import config
from blackbelt.circle import Client
import os




"""
Integration exploratory playground for CircleCI.
Don't really treat it as a test, but it may still be useful for you.
"""


class TestBuildInfoRetrieval(object):

    def setUp(self):
        try:

# Path: blackbelt/config.py

# 
# Path: blackbelt/circle.py
# class Client(object):
# 
#     def __init__(self, token=None):
#         if not token:
#             token = config['circleci']['access_token']
# 
#         if not token:
#             raise ValueError("Can't do things with CircleCI without access token. Run bb init.")
# 
#         self.token = token
# 
#         self.default_headers = {
#             'Accept': 'application/json',
#             'Content-Type': 'application/json'
#         }
# 
#         self.endpoint = 'https://circleci.com/api/v1'
# 
#     def get_url(self, url, **kwargs):
#         kwargs['token'] = self.token
# 
#         url = self.endpoint + url + '?circle-token={token}'
#         return url.format(**kwargs)
# 
#     def request(self, method, url, data=None):
#         res = getattr(requests, method)(url, headers=self.default_headers)
#         if not res.ok:
#             raise ValueError("Request to URL %s failed" % url)
# 
#         return res.json()
# 
#     def get_builds(self, username, project):
#         url = self.get_url(
#             '/project/{username}/{project}',
#             username=username,
#             project=project
#         )
# 
#         return self.request('get', url)
# 
#     def get_build(self, username, project, number):
#         url = self.get_url(
#             '/project/{username}/{project}/{number}',
#             username=username,
#             project=project,
#             number=number
#         )
# 
#         return self.request('get', url)


# Path: test/test_circle.py
from nose.plugins.skip import SkipTest
from blackbelt.config import config
from blackbelt.circle import Client
import os





"""
Integration exploratory playground for CircleCI.
Don't really treat it as a test, but it may still be useful for you.
"""


class TestBuildInfoRetrieval(object):

    def setUp(self):
        try:

            self.client = Client()