# Path: dgitcore/api.py
# def api_call_action(func): 
#     def _inner(*args, **kwargs):
# def _reexport(mod):
# def initialize():
# 
# Path: dgitcore/helper.py
# class cd:
#     """Context manager for changing the current working directory"""
#     def __init__(self, newPath):
#         self.newPath = os.path.expanduser(newPath)
# 
#     def __enter__(self):
#         self.savedPath = os.getcwd()
#         os.chdir(self.newPath)
# 
#     def __exit__(self, etype, value, traceback):
#         os.chdir(self.savedPath)


import os, sys, shutil, tempfile, json, stat
from nose import with_setup
from nose.tools import assert_raises
from unittest import TestCase
from dgitcore.exceptions import *
from dgitcore import api
from dgitcore.helper import cd

####################################################
# This file has (an incomplete) list of tests for the API. In
# particular it tests whether repos are being created correctly, and
# when we add files they do show up in all the right places. The list
# is not complete. This needs more work.
####################################################

# setup the test environment and then import dgitcore
thisdir = os.path.dirname(os.path.abspath(__file__))
os.environ['DGIT_INI'] = os.path.join(thisdir,
                                      'assets',
                                      'dgit-api.ini')

###########################################
# Setup and tear down
###########################################

def clean_workspace():
    """
    Clean the working space
    """

# Path: dgitcore/api.py
# def api_call_action(func): 
#     def _inner(*args, **kwargs):
# def _reexport(mod):
# def initialize():
# 
# Path: dgitcore/helper.py
# class cd:
#     """Context manager for changing the current working directory"""
#     def __init__(self, newPath):
#         self.newPath = os.path.expanduser(newPath)
# 
#     def __enter__(self):
#         self.savedPath = os.getcwd()
#         os.chdir(self.newPath)
# 
#     def __exit__(self, etype, value, traceback):
#         os.chdir(self.savedPath)


# Path: tests/test_api.py
import os, sys, shutil, tempfile, json, stat
from nose import with_setup
from nose.tools import assert_raises
from unittest import TestCase
from dgitcore.exceptions import *
from dgitcore import api
from dgitcore.helper import cd


####################################################
# This file has (an incomplete) list of tests for the API. In
# particular it tests whether repos are being created correctly, and
# when we add files they do show up in all the right places. The list
# is not complete. This needs more work.
####################################################

# setup the test environment and then import dgitcore
thisdir = os.path.dirname(os.path.abspath(__file__))
os.environ['DGIT_INI'] = os.path.join(thisdir,
                                      'assets',
                                      'dgit-api.ini')

###########################################
# Setup and tear down
###########################################

def clean_workspace():
    """
    Clean the working space
    """

    config = api.get_config()