# Path: pyfusion/test/tests.py
# class PfTestBase(object):
#     """Base class for generated sql and non-sql test cases."""
#     pass
# 
# class BasePyfusionTestCase(unittest.TestCase):
#     """Simple customisation of TestCase."""
#     def __init__(self, *args):
#         self.listed_device = CONFIG_TEST_DEVICE_NAME
#         self.listed_empty_device = CONFIG_EMPTY_TEST_DEVICE_NAME
#         self.unlisted_device = NONCONFIG_TEST_DEVICE_NAME
#         self.shot_number = TEST_SHOT_NUMBER
#         self.unlisted_config_section_type = UNLISTED_CONFIG_SECTION_TYPE
#         unittest.TestCase.__init__(self, *args)
# 
# Path: pyfusion/data/base.py
# class BaseData(object):
#     """Base class for handling processed data.
# 
#     In general, specialised subclasses of BaseData will be used
#     to handle processed data rather than BaseData itself.
# 
#     Usage: ..........
#     """
#     __metaclass__ = MetaMethods
# 
#     def __init__(self):
#         self.meta = PfMetaData()
#         self.history = "%s > New %s" %(datetime.now(), self.__class__.__name__)
#         if not hasattr(self, 'channels'):
#             self.channels = ChannelList()
#         
#     def save(self):
#         if pyfusion.orm_manager.IS_ACTIVE:
#             # this may be inefficient: get it working, then get it fast
#             self.channels.save()
#             session = pyfusion.orm_manager.Session()
#             session.add(self)
#             session.commit()
#             session.close()


import os
import pyfusion
        import pyfusion
        import pyfusion
from pyfusion.test.tests import PfTestBase, BasePyfusionTestCase
from pyfusion.data.base import BaseData
    from pyfusion.acquisition.MDSPlus.fetch import MDSPlusBaseDataFetcher
    from pyfusion.data.base import BaseData as MDSPlusBaseDataFetcher
        from pyfusion.acquisition.MDSPlus.acq import MDSPlusAcquisition
        from pyfusion.acquisition.base import BaseAcquisition
        from pyfusion.acquisition.MDSPlus.acq import MDSPlusAcquisition
        from pyfusion.acquisition.base import BaseDataFetcher
        from pyfusion.acquisition.MDSPlus.fetch import MDSPlusDataFetcher
        from pyfusion.acquisition.MDSPlus.acq import MDSPlusAcquisition
        from pyfusion.data.timeseries import TimeseriesData
        from pyfusion.acquisition.utils import get_acq_from_config
"""Test code for MDSPlus data acquisition."""

try:
except:
    # importing  MDSPlusBaseDataFetcher  will  fail  if MDSPlus  is  not
    # installed.   in general,  we  avoid mds  in  nosttests by  calling
    # nosetests -a '!mds'  pyfusion but in this case,  the import occurs
    # outside of a class definition, and can't be avoided with -a '!mds'
    
    # As  a kludge, we'll  put another  class into  the namespace  so we
    # don't get a syntax error when  we subclass it. (We don't care that
    # the subclass isn't what we want  because we're not going to use it
    # anyway if we don't have MDSPlus)


TEST_DATA_PATH = os.path.abspath(os.path.dirname(__file__))
TEST_CONFIG_FILE = os.path.join(TEST_DATA_PATH, "test.cfg")
TEST_MDSPLUS_SERVER = 'localhost:8001'

class DummyMDSData(BaseData):
    pass

class DummyMDSDataFetcher(MDSPlusBaseDataFetcher):
    """Check that we have a mds data object passed though"""
    def do_fetch(self):
        # this breaks unit tests:
        #data = DummyMDSData()
        # this doesn't. Why??

# Path: pyfusion/test/tests.py
# class PfTestBase(object):
#     """Base class for generated sql and non-sql test cases."""
#     pass
# 
# class BasePyfusionTestCase(unittest.TestCase):
#     """Simple customisation of TestCase."""
#     def __init__(self, *args):
#         self.listed_device = CONFIG_TEST_DEVICE_NAME
#         self.listed_empty_device = CONFIG_EMPTY_TEST_DEVICE_NAME
#         self.unlisted_device = NONCONFIG_TEST_DEVICE_NAME
#         self.shot_number = TEST_SHOT_NUMBER
#         self.unlisted_config_section_type = UNLISTED_CONFIG_SECTION_TYPE
#         unittest.TestCase.__init__(self, *args)
# 
# Path: pyfusion/data/base.py
# class BaseData(object):
#     """Base class for handling processed data.
# 
#     In general, specialised subclasses of BaseData will be used
#     to handle processed data rather than BaseData itself.
# 
#     Usage: ..........
#     """
#     __metaclass__ = MetaMethods
# 
#     def __init__(self):
#         self.meta = PfMetaData()
#         self.history = "%s > New %s" %(datetime.now(), self.__class__.__name__)
#         if not hasattr(self, 'channels'):
#             self.channels = ChannelList()
#         
#     def save(self):
#         if pyfusion.orm_manager.IS_ACTIVE:
#             # this may be inefficient: get it working, then get it fast
#             self.channels.save()
#             session = pyfusion.orm_manager.Session()
#             session.add(self)
#             session.commit()
#             session.close()


# Path: pyfusion/acquisition/MDSPlus/tests.py
import os
import pyfusion
        import pyfusion
        import pyfusion
from pyfusion.test.tests import PfTestBase, BasePyfusionTestCase
from pyfusion.data.base import BaseData
    from pyfusion.acquisition.MDSPlus.fetch import MDSPlusBaseDataFetcher
    from pyfusion.data.base import BaseData as MDSPlusBaseDataFetcher
        from pyfusion.acquisition.MDSPlus.acq import MDSPlusAcquisition
        from pyfusion.acquisition.base import BaseAcquisition
        from pyfusion.acquisition.MDSPlus.acq import MDSPlusAcquisition
        from pyfusion.acquisition.base import BaseDataFetcher
        from pyfusion.acquisition.MDSPlus.fetch import MDSPlusDataFetcher
        from pyfusion.acquisition.MDSPlus.acq import MDSPlusAcquisition
        from pyfusion.data.timeseries import TimeseriesData
        from pyfusion.acquisition.utils import get_acq_from_config

"""Test code for MDSPlus data acquisition."""

try:
except:
    # importing  MDSPlusBaseDataFetcher  will  fail  if MDSPlus  is  not
    # installed.   in general,  we  avoid mds  in  nosttests by  calling
    # nosetests -a '!mds'  pyfusion but in this case,  the import occurs
    # outside of a class definition, and can't be avoided with -a '!mds'
    
    # As  a kludge, we'll  put another  class into  the namespace  so we
    # don't get a syntax error when  we subclass it. (We don't care that
    # the subclass isn't what we want  because we're not going to use it
    # anyway if we don't have MDSPlus)


TEST_DATA_PATH = os.path.abspath(os.path.dirname(__file__))
TEST_CONFIG_FILE = os.path.join(TEST_DATA_PATH, "test.cfg")
TEST_MDSPLUS_SERVER = 'localhost:8001'

class DummyMDSData(BaseData):
    pass

class DummyMDSDataFetcher(MDSPlusBaseDataFetcher):
    """Check that we have a mds data object passed though"""
    def do_fetch(self):
        # this breaks unit tests:
        #data = DummyMDSData()
        # this doesn't. Why??

        data = BaseData()