Changeset View
Changeset View
Standalone View
Standalone View
swh/model/tests/test_identifiers.py
Show First 20 Lines • Show All 887 Lines • ▼ Show 20 Lines | def test_parse_persistent_identifier_parsing_error(self): | ||||
('swh:1:snp:gh6959356d30f1a4e9b7f6bca59b9a336464c03d', | ('swh:1:snp:gh6959356d30f1a4e9b7f6bca59b9a336464c03d', | ||||
'Wrong format: Identifier should be a valid hash'), | 'Wrong format: Identifier should be a valid hash'), | ||||
('swh:1:snp:foo', | ('swh:1:snp:foo', | ||||
'Wrong format: Identifier should be a valid hash') | 'Wrong format: Identifier should be a valid hash') | ||||
]: | ]: | ||||
with self.assertRaisesRegex( | with self.assertRaisesRegex( | ||||
ValidationError, _error): | ValidationError, _error): | ||||
identifiers.parse_persistent_identifier(pid) | identifiers.parse_persistent_identifier(pid) | ||||
class OriginIdentifier(unittest.TestCase): | |||||
def setUp(self): | |||||
self.origin = { | |||||
ardumont: Drop the type if it is not used. | |||||
'type': 'git', | |||||
'url': 'https://github.com/torvalds/linux', | |||||
} | |||||
def test_content_identifier(self): | |||||
self.assertEqual(identifiers.origin_identifier(self.origin), | |||||
'b63a575fe3faab7692c9f38fb09d4bb45651bb0f') |
Drop the type if it is not used.