@requires_application()
def test_capability():
 non_default_vals = dict(title='foo', size=[100, 100], position=[0, 0], show=True, decorate=False, resizable=False, vsync=True)
 good_kwargs = dict()
 bad_kwargs = dict()
 with Canvas() as c:
  for (key, val) in c.app.backend_module.capability.items():
   if (key in non_default_vals):
    if val:
     good_kwargs[key] = non_default_vals[key]
    else:
     bad_kwargs[key] = non_default_vals[key]
 with Canvas(**good_kwargs):
  pass
 for (key, val) in bad_kwargs.items():
  assert_raises(RuntimeError, Canvas, **{key: val})

@ requires_application ( ) def test_capability ( ) : non_default_vals = dict ( title = 'foo' , size = [ 100 , 100 ] , position = [ 0 , 0 ] , show = True , decorate = False , resizable = False , vsync = True ) good_kwargs = dict ( ) bad_kwargs = dict ( ) with Canvas ( ) as c : for ( key , val ) in c . app . backend_module . capability . items ( ) : if ( key in non_default_vals ) : if val : good_kwargs [ key ] = non_default_vals [ key ] else : bad_kwargs [ key ] = non_default_vals [ key ] with Canvas ( ** good_kwargs ) : pass for ( key , val ) in bad_kwargs . items ( ) : assert_raises ( RuntimeError , Canvas , ** { key : val } )
test application capability enumeration .