# 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
    def testDataFetcherBaseClass(self):
        self.assertTrue(BaseDataFetcher in MDSPlusDataFetcher.__bases__)
    
    #def testMDSDataObjectArg(self):
    #    dummy_shot = 12345
    #    from pyfusion.acquisition.MDSPlus.acq import MDSPlusAcquisition
    #    test_acq = MDSPlusAcquisition(server="h1data.anu.edu.au")
    #    test_fetch = DummyMDSDataFetcher(dummy_shot, _Data=test_acq._Data, mds_tree='H1DATA')
    #    test_data_obj = test_fetch.fetch()

    #def testMDSDataObjectAcq(self):
    #    dummy_shot = 12345
    #    from pyfusion.acquisition.MDSPlus.acq import MDSPlusAcquisition
    #    #test_acq = MDSPlusAcquisition(server="h1data.anu.edu.au")
    #    test_acq = MDSPlusAcquisition(server=TEST_MDSPLUS_SERVER)
    #    #test_fetch = DummyMDSDataFetcher(dummy_shot, _Data=None)
    #    #test_data_obj = test_fetch.fetch()
    #    # TODO: should be able to pass either string or module 
    #    df_str = "pyfusion.acquisition.MDSPlus.tests.DummyMDSDataFetcher"
    #    test_data = test_acq.getdata(dummy_shot, data_fetcher=df_str, mds_tree="H1DATA")
    #    from MDSplus import Data
    #    self.assertEqual(Data.__dict__, test_data.meta['mds_Data'].__dict__)
        
CheckMDSPlusDataFetchers.h1 = True
CheckMDSPlusDataFetchers.mds = True
CheckMDSPlusDataFetchers.net = True
CheckMDSPlusDataFetchers.slow = True




# 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

    def testDataFetcherBaseClass(self):
        self.assertTrue(BaseDataFetcher in MDSPlusDataFetcher.__bases__)
    
    #def testMDSDataObjectArg(self):
    #    dummy_shot = 12345
    #    from pyfusion.acquisition.MDSPlus.acq import MDSPlusAcquisition
    #    test_acq = MDSPlusAcquisition(server="h1data.anu.edu.au")
    #    test_fetch = DummyMDSDataFetcher(dummy_shot, _Data=test_acq._Data, mds_tree='H1DATA')
    #    test_data_obj = test_fetch.fetch()

    #def testMDSDataObjectAcq(self):
    #    dummy_shot = 12345
    #    from pyfusion.acquisition.MDSPlus.acq import MDSPlusAcquisition
    #    #test_acq = MDSPlusAcquisition(server="h1data.anu.edu.au")
    #    test_acq = MDSPlusAcquisition(server=TEST_MDSPLUS_SERVER)
    #    #test_fetch = DummyMDSDataFetcher(dummy_shot, _Data=None)
    #    #test_data_obj = test_fetch.fetch()
    #    # TODO: should be able to pass either string or module 
    #    df_str = "pyfusion.acquisition.MDSPlus.tests.DummyMDSDataFetcher"
    #    test_data = test_acq.getdata(dummy_shot, data_fetcher=df_str, mds_tree="H1DATA")
    #    from MDSplus import Data
    #    self.assertEqual(Data.__dict__, test_data.meta['mds_Data'].__dict__)
        
CheckMDSPlusDataFetchers.h1 = True
CheckMDSPlusDataFetchers.mds = True
CheckMDSPlusDataFetchers.net = True
CheckMDSPlusDataFetchers.slow = True




class CheckMDSPlusH1Connection(PfTestBase):