<s> import unittest <EOL> from comtypes . test import ResourceDenied <EOL> from comtypes . client import CreateObject <EOL> from comtypes import GUID <EOL> from comtypes . safearray import _midlSAFEARRAY <EOL> from ctypes import c_double , POINTER <EOL> try : <EOL> GUID . from_progid ( "<STR_LIT>" ) <EOL> except WindowsError : <EOL> pass <EOL> else : <EOL> class Test ( unittest . TestCase ) : <EOL> def test ( self ) : <EOL> agDrvr = CreateObject ( "<STR_LIT>" ) <EOL> import os <EOL> if "<STR_LIT>" in os . environ : <EOL> print "<STR_LIT>" <EOL> return <EOL> agDrvr . Initialize ( "<STR_LIT>" , False , False , "<STR_LIT>" ) <EOL> from comtypes . gen import IviScopeLib <EOL> iviDrvr = agDrvr . QueryInterface ( IviScopeLib . IIviScope ) <EOL> agDrvr . Utility . Reset ( ) <EOL> pMeasurement = agDrvr . Measurements . Item ( "<STR_LIT>" ) <EOL> psaWaveform = _midlSAFEARRAY ( c_double ) . create ( [ ] ) <EOL> self . _check_result ( pMeasurement . ReadWaveform ( <NUM_LIT> ) ) <EOL> self . _check_result ( pMeasurement . ReadWaveform ( <NUM_LIT> , pInitialX = <NUM_LIT> ) ) <EOL> self . _check_result ( pMeasurement . ReadWaveform ( <NUM_LIT> , pXIncrement = <NUM_LIT> , pInitialX = <NUM_LIT> ) ) <EOL> self . _check_result ( pMeasurement . ReadWaveform ( <NUM_LIT> ) ) <EOL> self . _check_result ( pMeasurement . ReadWaveform ( <NUM_LIT> , [ ] ) ) <EOL> self . _check_result ( pMeasurement . ReadWaveform ( <NUM_LIT> , pWaveformArray = [ ] ) ) <EOL> self . _check_result ( pMeasurement . ReadWaveform ( <NUM_LIT> , psaWaveform ) ) <EOL> self . _check_result ( pMeasurement . ReadWaveform ( <NUM_LIT> , pXIncrement = <NUM_LIT> ) ) <EOL> def _check_result ( self , ( array , initial_x , x_increment ) ) : <EOL> self . failUnlessEqual ( len ( array ) , <NUM_LIT:100> ) <EOL> self . failIf ( [ x for x in array if not isinstance ( x , float ) ] ) <EOL> self . failUnlessEqual ( initial_x , <NUM_LIT:0.0> ) <EOL> self . failUnlessEqual ( x_increment , <NUM_LIT:0.0> ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
