def test_hosts_and_roles_together():
 @roles('r1', 'r2')
 @hosts('d')
 def command():
  pass
 eq_hosts(command, ['a', 'b', 'c', 'd'], env={'roledefs': fake_roles})
 eq_effective_roles(command, ['r1', 'r2'], env={'roledefs': fake_roles})

def test_hosts_and_roles_together ( ) : @ roles ( 'r1' , 'r2' ) @ hosts ( 'd' ) def command ( ) : pass eq_hosts ( command , [ 'a' , 'b' , 'c' , 'd' ] , env = { 'roledefs' : fake_roles } ) eq_effective_roles ( command , [ 'r1' , 'r2' ] , env = { 'roledefs' : fake_roles } )
use of @roles and @hosts together results in union of both .