# Path: attributes/stars/main.py
# def run(project_id, repo_path, cursor, **options):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/database.py
# class DatabaseError(Exception):
# class Database(object):
#     def __init__(self, value):
#     def __str__(self):
#     def __init__(self, settings):
#     def connect(self):
#     def disconnect(self):
#     def get(self, query):
#     def post(self, query, data=None):
#     def cursor(self):
#     def _connected(self):
#     def __getstate__(self):
#     def __setstate__(self, state):
# 
# Path: lib/dateutil.py
# class relativedelta(relativedelta.relativedelta):
#     def total_hours(self):
#     def total_minutes(self):
#     def total_seconds(self):
#     def __lt__(self, other):
#     def __gt__(self, other):
#     def __le__(self, other):
#     def __ge__(self, other):
# 
# Path: lib/utilities.py
# TOKENIZER = None
# ACK_LANGUAGE_MAP = {
#     'c': 'cc',
#     'c++': 'cpp',
#     'c#': 'csharp',
#     'objective-c': 'objc',
#     'ojective-c++': 'objcpp',
# }
# def get_cache_hits():
# def get_loc(path, files=None):
# def search(
#     pattern, path, recursive=True, whole=False, ignorecase=False, include=None,
#     exclude=None
# ):
# def url_to_json(url, headers={}):
# def get_repo_path(repo_id, repositories_dir):
# def clone(owner, name, directory, date=None):
# def read(jsonfile):
# def parse_datetime_delta(datetime_delta):
# def is_cloneable(owner, name):
# def get_files(path, language):


import json
import os
import unittest
from attributes.stars import main
from lib import core, database, dateutil, utilities



class MainTestCase(unittest.TestCase):
    def setUp(self):
        path = (
            os.path.join(
                os.path.abspath(
                    os.path.join(
                        os.path.dirname(os.path.realpath(__file__)),
                        os.pardir,
                        os.pardir
                    )
                ),
                'config.json'
            )
        )
        config = None
        with open(path, 'r') as file_:
            config = utilities.read(file_)

        self.database = database.Database(config['options']['datasource'])
        core.config = config

# Path: attributes/stars/main.py
# def run(project_id, repo_path, cursor, **options):
# 
# Path: lib/core.py
# class Tokenizer():
#     def __init__(self):
#     def tokenize(self, url):
#     def get_token(self):
#     def print_warning(self, message):
# 
# Path: lib/database.py
# class DatabaseError(Exception):
# class Database(object):
#     def __init__(self, value):
#     def __str__(self):
#     def __init__(self, settings):
#     def connect(self):
#     def disconnect(self):
#     def get(self, query):
#     def post(self, query, data=None):
#     def cursor(self):
#     def _connected(self):
#     def __getstate__(self):
#     def __setstate__(self, state):
# 
# Path: lib/dateutil.py
# class relativedelta(relativedelta.relativedelta):
#     def total_hours(self):
#     def total_minutes(self):
#     def total_seconds(self):
#     def __lt__(self, other):
#     def __gt__(self, other):
#     def __le__(self, other):
#     def __ge__(self, other):
# 
# Path: lib/utilities.py
# TOKENIZER = None
# ACK_LANGUAGE_MAP = {
#     'c': 'cc',
#     'c++': 'cpp',
#     'c#': 'csharp',
#     'objective-c': 'objc',
#     'ojective-c++': 'objcpp',
# }
# def get_cache_hits():
# def get_loc(path, files=None):
# def search(
#     pattern, path, recursive=True, whole=False, ignorecase=False, include=None,
#     exclude=None
# ):
# def url_to_json(url, headers={}):
# def get_repo_path(repo_id, repositories_dir):
# def clone(owner, name, directory, date=None):
# def read(jsonfile):
# def parse_datetime_delta(datetime_delta):
# def is_cloneable(owner, name):
# def get_files(path, language):


# Path: tests/stars/test_main.py
import json
import os
import unittest
from attributes.stars import main
from lib import core, database, dateutil, utilities




class MainTestCase(unittest.TestCase):
    def setUp(self):
        path = (
            os.path.join(
                os.path.abspath(
                    os.path.join(
                        os.path.dirname(os.path.realpath(__file__)),
                        os.pardir,
                        os.pardir
                    )
                ),
                'config.json'
            )
        )
        config = None
        with open(path, 'r') as file_:
            config = utilities.read(file_)

        self.database = database.Database(config['options']['datasource'])
        core.config = config

        utilities.TOKENIZER = core.Tokenizer()