def test_context_config():
 default_config = get_default_config()
 c = GLContext(default_config)
 assert_equal(c.config, default_config)
 c.config['double_buffer'] = False
 assert_not_equal(c.config, default_config)
 c = GLContext()
 assert_equal(c.config, default_config)
 c.config['double_buffer'] = False
 assert_not_equal(c.config, default_config)
 c = GLContext({'red_size': 4, 'double_buffer': False})
 assert_equal(c.config.keys(), default_config.keys())
 assert_raises(KeyError, GLContext, {'foo': 3})
 assert_raises(TypeError, GLContext, {'double_buffer': 'not_bool'})
 assert ('gl_version' in c.capabilities)

def test_context_config ( ) : default_config = get_default_config ( ) c = GLContext ( default_config ) assert_equal ( c . config , default_config ) c . config [ 'double_buffer' ] = False assert_not_equal ( c . config , default_config ) c = GLContext ( ) assert_equal ( c . config , default_config ) c . config [ 'double_buffer' ] = False assert_not_equal ( c . config , default_config ) c = GLContext ( { 'red_size' : 4 , 'double_buffer' : False } ) assert_equal ( c . config . keys ( ) , default_config . keys ( ) ) assert_raises ( KeyError , GLContext , { 'foo' : 3 } ) assert_raises ( TypeError , GLContext , { 'double_buffer' : 'not_bool' } ) assert ( 'gl_version' in c . capabilities )
test glcontext handling of config dict .