# Path: binstar_client/inspect_package/env.py
# class EnvInspector(object):
#     def __init__(self, filename, fileobj):
#         self._name = None
#         self._version = None
#         self.filename = filename
#         self.content = yaml_load(fileobj)
# 
#     @property
#     def basename(self):
#         return os.path.basename(self.filename)
# 
#     @property
#     def name(self):
#         if self._name is None:
#             self._name = self.content['name']
#         return self._name
# 
#     def get_package_data(self):
#         return {
#             'name': self.name,
#             'summary': "Environment file"
#         }
# 
#     @property
#     def version(self):
#         if self._version is None:
#             self._version = time.strftime('%Y.%m.%d.%H%M%S')
# 
#         return self._version
# 
# def inspect_env_package(filename, fileobj, *args, **kwargs):
#     environment = EnvInspector(filename, fileobj)
# 
#     package_data = environment.get_package_data()
#     release_data = {
#         'version': environment.version,
#         'description': ''
#     }
#     file_data = {
#         'basename': environment.basename,
#         'attrs': {}
#     }
# 
#     return package_data, release_data, file_data
# 
# Path: binstar_client/utils/test/utils.py
# def data_dir(filename):
#     base_path = inspect.stack()[1][1]  # function caller path
#     test_data = os.path.join(os.path.dirname(base_path), 'data')
#     return os.path.join(test_data, filename)


import unittest
from ..env import EnvInspector, inspect_env_package
from binstar_client.utils.test.utils import data_dir



class EnvInspectorTestCase(unittest.TestCase):
    def test_package_name(self):
        with open(data_dir('environment.yml')) as fileobj:
            assert EnvInspector('environment.yml', fileobj).name == 'stats'

    def test_version(self):
        with open(data_dir('environment.yml')) as fileobj:
            self.assertIsInstance(EnvInspector('environment.yml', fileobj).version, str)


class InspectEnvironmentPackageTest(unittest.TestCase):
    def test_inspect_env_package(self):

# Path: binstar_client/inspect_package/env.py
# class EnvInspector(object):
#     def __init__(self, filename, fileobj):
#         self._name = None
#         self._version = None
#         self.filename = filename
#         self.content = yaml_load(fileobj)
# 
#     @property
#     def basename(self):
#         return os.path.basename(self.filename)
# 
#     @property
#     def name(self):
#         if self._name is None:
#             self._name = self.content['name']
#         return self._name
# 
#     def get_package_data(self):
#         return {
#             'name': self.name,
#             'summary': "Environment file"
#         }
# 
#     @property
#     def version(self):
#         if self._version is None:
#             self._version = time.strftime('%Y.%m.%d.%H%M%S')
# 
#         return self._version
# 
# def inspect_env_package(filename, fileobj, *args, **kwargs):
#     environment = EnvInspector(filename, fileobj)
# 
#     package_data = environment.get_package_data()
#     release_data = {
#         'version': environment.version,
#         'description': ''
#     }
#     file_data = {
#         'basename': environment.basename,
#         'attrs': {}
#     }
# 
#     return package_data, release_data, file_data
# 
# Path: binstar_client/utils/test/utils.py
# def data_dir(filename):
#     base_path = inspect.stack()[1][1]  # function caller path
#     test_data = os.path.join(os.path.dirname(base_path), 'data')
#     return os.path.join(test_data, filename)


# Path: binstar_client/inspect_package/tests/test_env.py
import unittest
from ..env import EnvInspector, inspect_env_package
from binstar_client.utils.test.utils import data_dir




class EnvInspectorTestCase(unittest.TestCase):
    def test_package_name(self):
        with open(data_dir('environment.yml')) as fileobj:
            assert EnvInspector('environment.yml', fileobj).name == 'stats'

    def test_version(self):
        with open(data_dir('environment.yml')) as fileobj:
            self.assertIsInstance(EnvInspector('environment.yml', fileobj).version, str)


class InspectEnvironmentPackageTest(unittest.TestCase):
    def test_inspect_env_package(self):

        with open(data_dir('environment.yml')) as fileobj: