<s> """<STR_LIT>""" <EOL> from vispy . testing import requires_pyopengl <EOL> from vispy . gloo import gl <EOL> from vispy . testing import run_tests_if_main <EOL> def teardown_module ( ) : <EOL> gl . use_gl ( ) <EOL> class _DummyObject : <EOL> """<STR_LIT>""" <EOL> def LoadLibrary ( self , fname ) : <EOL> return _DummyObject ( ) <EOL> def __getattr__ ( self , name ) : <EOL> setattr ( self , name , self . __class__ ( ) ) <EOL> return getattr ( self , name ) <EOL> def _test_function_names ( mod ) : <EOL> fnames = set ( [ name for name in dir ( mod ) if name . startswith ( '<STR_LIT>' ) ] ) <EOL> assert function_names . difference ( fnames ) == set ( ) <EOL> assert fnames . difference ( function_names ) . difference ( ok_names ) == set ( ) <EOL> def _test_constant_names ( mod ) : <EOL> cnames = set ( [ name for name in dir ( mod ) if name . startswith ( '<STR_LIT>' ) ] ) <EOL> assert constant_names . difference ( cnames ) == set ( ) <EOL> assert cnames . difference ( constant_names ) == set ( ) <EOL> def test_destop ( ) : <EOL> """<STR_LIT>""" <EOL> from vispy . gloo . gl import gl2 <EOL> _test_function_names ( gl2 ) <EOL> _test_constant_names ( gl2 ) <EOL> def test_es2 ( ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> from vispy . gloo . gl import es2 <EOL> except Exception : <EOL> import ctypes <EOL> ctypes . TEST_DLL = _DummyObject ( ) <EOL> from vispy . gloo . gl import es2 <EOL> _test_function_names ( es2 ) <EOL> _test_constant_names ( es2 ) <EOL> @ requires_pyopengl ( ) <EOL> def test_pyopengl ( ) : <EOL> """<STR_LIT>""" <EOL> from vispy . gloo . gl import pyopengl2 <EOL> _test_function_names ( pyopengl2 ) <EOL> _test_constant_names ( pyopengl2 ) <EOL> @ requires_pyopengl ( ) <EOL> def test_glplus ( ) : <EOL> """<STR_LIT>""" <EOL> gl . use_gl ( '<STR_LIT>' ) <EOL> fnames = set ( [ name for name in dir ( gl ) if name . startswith ( '<STR_LIT>' ) ] ) <EOL> assert len ( fnames . difference ( function_names ) . difference ( [ '<STR_LIT>' ] ) ) > <NUM_LIT:50> <EOL> cnames = set ( [ name for name in dir ( gl ) if name . startswith ( '<STR_LIT>' ) ] ) <EOL> assert len ( cnames . difference ( constant_names ) ) > <NUM_LIT:50> <EOL> gl . use_gl ( '<STR_LIT>' ) <EOL> _test_function_names ( gl ) <EOL> _test_constant_names ( gl ) <EOL> def test_proxy ( ) : <EOL> """<STR_LIT>""" <EOL> _test_function_names ( gl . proxy ) <EOL> _test_constant_names ( gl . _constants ) <EOL> def test_main ( ) : <EOL> """<STR_LIT>""" <EOL> _test_function_names ( gl ) <EOL> _test_constant_names ( gl ) <EOL> def _main ( ) : <EOL> """<STR_LIT>""" <EOL> test_main ( ) <EOL> test_proxy ( ) <EOL> test_destop ( ) <EOL> test_es2 ( ) <EOL> test_pyopengl ( ) <EOL> function_names = """<STR_LIT>""" . replace ( '<STR_LIT:\n>' , '<STR_LIT:U+0020>' ) <EOL> constant_names = """<STR_LIT>""" . replace ( '<STR_LIT:\n>' , '<STR_LIT:U+0020>' ) <EOL> function_names = [ n . strip ( ) for n in function_names . split ( '<STR_LIT:U+0020>' ) ] <EOL> function_names = set ( [ n for n in function_names if n ] ) <EOL> constant_names = [ n . strip ( ) for n in constant_names . split ( '<STR_LIT:U+0020>' ) ] <EOL> constant_names = set ( [ n for n in constant_names if n ] ) <EOL> ok_names = set ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> run_tests_if_main ( ) </s>
