'Create the implied roles specified in the test plan.'

def create_implied_roles(self, implied_pattern, test_data):

    for implied_spec in implied_pattern:
        prior_role = test_data['roles'][implied_spec['role']]['id']
        if isinstance(implied_spec['implied_roles'], list):
            for this_role in implied_spec['implied_roles']:
                implied_role = test_data['roles'][this_role]['id']
                self.role_api.create_implied_role(prior_role, implied_role)
        else:
            implied_role = test_data['roles'][implied_spec['implied_roles']]['id']
            self.role_api.create_implied_role(prior_role, implied_role)
