コード例 #1
0
def test_clr_list_assemblies():
    from clr import ListAssemblies
    verbose = list(ListAssemblies(True))
    short = list(ListAssemblies(False))
    assert u'System' in short
    assert u'Culture=' in verbose[0]
    assert u'Version=' in verbose[0]
コード例 #2
0
ファイル: test_module.py プロジェクト: cowboygneox/pythonnet
 def test_ClrListAssemblies(self):
     from clr import ListAssemblies
     verbose = list(ListAssemblies(True))
     short = list(ListAssemblies(False))
     self.assertTrue(six.u('mscorlib') in short)
     self.assertTrue(six.u('System') in short)
     self.assertTrue(six.u('Culture=') in verbose[0])
     self.assertTrue(six.u('Version=') in verbose[0])
コード例 #3
0
 def test_ClrListAssemblies(self):
     from clr import ListAssemblies 
     verbose = list(ListAssemblies(True))
     short = list(ListAssemblies(False))
     self.failUnless(u'mscorlib' in short)
     self.failUnless(u'System' in short)
     self.failUnless('Culture=' in verbose[0])
     self.failUnless('Version=' in verbose[0])
コード例 #4
0
ファイル: MassSpec.py プロジェクト: 5ggg/vimms
    def __init__(self,
                 ionisation_mode,
                 ref_dir,
                 filename=None,
                 show_console_logs=True,
                 log_dir='C:\\Xcalibur\\data\\Joe\\logs'):
        super().__init__(ionisation_mode, [], None, add_noise=False)

        # create IAPI log directory if it doesn't exist
        self.log_dir = log_dir
        create_if_not_exist(self.log_dir)

        # import PythonNet. We will use this to communicate with Thermo IAPI

        # noinspection PyUnresolvedReferences
        import clr
        # noinspection PyUnresolvedReferences
        from clr import ListAssemblies

        # add IAPI .dll location to Python path.
        if ref_dir not in sys.path:
            sys.path.append(ref_dir)

        # make sure IAPI assemblies can be found
        assert clr.FindAssembly('FusionLibrary') is not None
        ref = clr.AddReference('FusionLibrary')
        logger.debug('AddReference: %s' % ref)

        short = list(ListAssemblies(False))
        logger.debug('ListAssemblies: %s' % str(short))
        assert 'Fusion.API-1.0' in short
        assert 'API-2.0' in short
        assert 'Spectrum-1.0' in short
        assert 'FusionLibrary' in short
        self.filename = filename
        self.show_console_logs = show_console_logs
        self.running_number = 100000
        self.fusion_bridge = None
        self.scan_number_to_params = {}