<s> from servi . template_mgr import * <EOL> from tests . fixtures import * <EOL> PLAYBOOK_TESTDATA = '''<STR_LIT>''' <EOL> TEMPLATE_ROLES = { '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' } <EOL> @ pytest . fixture ( ) <EOL> def template_manager_setup ( setup_init ) : <EOL> tmgr = TemplateManager ( ) <EOL> return tmgr <EOL> def test_get_template_roles ( template_manager_setup ) : <EOL> res = template_manager_setup . roles <EOL> print ( res ) <EOL> assert len ( res ) >= <NUM_LIT:5> <EOL> assert { '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' } <= set ( res ) <EOL> def test_get_master_roles1 ( template_manager_setup ) : <EOL> tmgr = template_manager_setup <EOL> print ( '<STR_LIT>' , tmgr . roles ) <EOL> print ( '<STR_LIT>' , tmgr . possible_roles ) <EOL> assert len ( tmgr . roles ) >= <NUM_LIT:5> <EOL> assert { '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' } <= tmgr . roles <EOL> assert type ( tmgr . possible_roles ) is set <EOL> def test_get_master_roles2 ( template_manager_setup ) : <EOL> tmgr = TemplateManager ( raw_template_playbook = PLAYBOOK_TESTDATA ) <EOL> print ( '<STR_LIT>' , tmgr . roles ) <EOL> print ( '<STR_LIT>' , tmgr . possible_roles ) <EOL> assert tmgr . roles == { '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' } <EOL> assert tmgr . possible_roles == { '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' } <EOL> def test_role_of_fname ( template_manager_setup ) : <EOL> tmgr = template_manager_setup <EOL> assert tmgr . role_of_fname ( <EOL> '<STR_LIT>' ) == '<STR_LIT>' <EOL> assert tmgr . role_of_fname ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> assert tmgr . role_of_fname ( '<STR_LIT>' ) is None </s>
