FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit b346c792 authored by Monty Dawson's avatar Monty Dawson :coffee:
Browse files

Update tests for parsing card identifiers

parent dbc12c88
No related branches found
No related tags found
1 merge request!5Add identifiers for groups and apps
......@@ -39,18 +39,16 @@ class TestCardParsingMethods(TestCase):
def test_get_identifier_by_scheme_can_find_all_ids(self):
test_card = TestCardParsingMethods.card_with_all_ids
for id_scheme in IdentifierSchemes.get_registered_schemes():
expected_val = next(
(id['value'] for id in test_card['identifiers'] if id['scheme'] == str(id_scheme))
)
for identifier_dict in test_card['identifiers']:
scheme = identifier_dict['scheme']
value = identifier_dict['value']
self.assertEqual(
CardClient.get_identifier_by_scheme(test_card, id_scheme),
f'{expected_val}@{id_scheme}'.lower()
CardClient.get_identifier_by_scheme(test_card, scheme),
f'{value}@{scheme}'.lower()
)
def test_get_identifier_by_scheme_returns_none_for_no_matching_identifer(self):
def test_get_identifier_by_scheme_returns_none_for_no_matching_identifier(self):
test_card = {'identifiers': []}
for id_scheme in IdentifierSchemes.get_registered_schemes():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment