# Path: attributes/history/main.py
# def run(project_id, repo_path, cursor, **options):
# 
# 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):


import json
import os
import unittest
from attributes.history import main
from lib import database
        # Arrange
        project_id = 10868464  # andymeneely/squib
        options = {
            'threshold': 1,
            'minimumDurationInMonths': 1
        }

        # Act
        try:
            self.database.connect()
            with self.database.cursor() as cursor:
                (result, value) = main.run(project_id, '', cursor, **options)
        finally:
            self.database.disconnect()

        # Assert
        self.assertTrue(result)
        self.assertLess(0, value)

        # Arrange
        project_id = 581  # torvalds/linux
        options = {
            'threshold': 1,
            'minimumDurationInMonths': 1
        }

        # Act
        try:
            self.database.connect()
            with self.database.cursor() as cursor:

# Path: attributes/history/main.py
# def run(project_id, repo_path, cursor, **options):
# 
# 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: tests/history/test_main.py
import json
import os
import unittest
from attributes.history import main
from lib import database

        # Arrange
        project_id = 10868464  # andymeneely/squib
        options = {
            'threshold': 1,
            'minimumDurationInMonths': 1
        }

        # Act
        try:
            self.database.connect()
            with self.database.cursor() as cursor:
                (result, value) = main.run(project_id, '', cursor, **options)
        finally:
            self.database.disconnect()

        # Assert
        self.assertTrue(result)
        self.assertLess(0, value)

        # Arrange
        project_id = 581  # torvalds/linux
        options = {
            'threshold': 1,
            'minimumDurationInMonths': 1
        }

        # Act
        try:
            self.database.connect()
            with self.database.cursor() as cursor:

                (result, value) = main.run(project_id, '', cursor, **options)