def test_request_unimplemented_nameid(self): user = User(username='******', email='*****@*****.**') requested_nameid_format = 'notimplemented_nameid_format' NameIdBuilder.format_mappings[requested_nameid_format] = 'nonexisting_method' with pytest.raises(NotImplementedError, match=f'{requested_nameid_format} has not been implemented NameIdBuilder methods'): NameIdBuilder.get_nameid(user.username, nameid_format=requested_nameid_format)
def test_request_unmapped_nameid(self): user = User(username='******', email='*****@*****.**') requested_nameid_format = 'unmapped_nameid_format' with pytest.raises( NotImplementedError, match= f'{requested_nameid_format} has not been mapped in NameIdBuilder.format_mappings' ): NameIdBuilder.get_nameid(user.username, nameid_format=requested_nameid_format)