Changeset View
Changeset View
Standalone View
Standalone View
swh/model/tests/test_identifiers.py
Show First 20 Lines • Show All 619 Lines • ▼ Show 20 Lines | ''', | ||||
'message': b'Release of v0.3.2.', | 'message': b'Release of v0.3.2.', | ||||
'name': b'0.3.2', | 'name': b'0.3.2', | ||||
'synthetic': False, | 'synthetic': False, | ||||
'target': (b'\xc0j\xa3\xd9;x\xa2\x86\\I5\x17' | 'target': (b'\xc0j\xa3\xd9;x\xa2\x86\\I5\x17' | ||||
b'\x000\xf8\xc2\xd79o\xd3'), | b'\x000\xf8\xc2\xd79o\xd3'), | ||||
'target_type': 'revision', | 'target_type': 'revision', | ||||
} | } | ||||
self.release_snapshot_target = dict(self.release) | |||||
self.release_snapshot_target['target_type'] = 'snapshot' | |||||
self.release_snapshot_target['id'] = ( | |||||
'c29c3ddcc6769a04e54dd69d63a6fdcbc566f850') | |||||
def test_release_identifier(self): | def test_release_identifier(self): | ||||
self.assertEqual( | self.assertEqual( | ||||
identifiers.release_identifier(self.release), | identifiers.release_identifier(self.release), | ||||
identifiers.identifier_to_str(self.release['id']) | identifiers.identifier_to_str(self.release['id']) | ||||
) | ) | ||||
def test_release_identifier_no_author(self): | def test_release_identifier_no_author(self): | ||||
self.assertEqual( | self.assertEqual( | ||||
Show All 20 Lines | def test_release_identifier_negative_utc(self): | ||||
) | ) | ||||
def test_release_identifier_newline_in_author(self): | def test_release_identifier_newline_in_author(self): | ||||
self.assertEqual( | self.assertEqual( | ||||
identifiers.release_identifier(self.release_newline_in_author), | identifiers.release_identifier(self.release_newline_in_author), | ||||
identifiers.identifier_to_str(self.release_newline_in_author['id']) | identifiers.identifier_to_str(self.release_newline_in_author['id']) | ||||
) | ) | ||||
def test_release_identifier_snapshot_target(self): | |||||
vlorentz: you forgot to remove this line | |||||
self.assertEqual( | |||||
identifiers.release_identifier(self.release_snapshot_target), | |||||
identifiers.identifier_to_str(self.release_snapshot_target['id']) | |||||
) | |||||
class SnapshotIdentifier(unittest.TestCase): | class SnapshotIdentifier(unittest.TestCase): | ||||
def setUp(self): | def setUp(self): | ||||
super().setUp() | super().setUp() | ||||
self.empty = { | self.empty = { | ||||
'id': '1a8893e6a86f444e8be8e7bda6cb34fb1735a00e', | 'id': '1a8893e6a86f444e8be8e7bda6cb34fb1735a00e', | ||||
'branches': {}, | 'branches': {}, | ||||
▲ Show 20 Lines • Show All 238 Lines • Show Last 20 Lines |
you forgot to remove this line