Changeset View
Changeset View
Standalone View
Standalone View
swh/model/tests/test_identifiers.py
Show First 20 Lines • Show All 749 Lines • ▼ Show 20 Lines | class SnapshotIdentifier(unittest.TestCase): | ||||
def test_dangling_branch(self): | def test_dangling_branch(self): | ||||
self.assertEqual( | self.assertEqual( | ||||
Snapshot.from_dict(remove_id(self.dangling_branch)).id, | Snapshot.from_dict(remove_id(self.dangling_branch)).id, | ||||
self.dangling_branch["id"], | self.dangling_branch["id"], | ||||
) | ) | ||||
def test_unresolved(self): | def test_unresolved(self): | ||||
with self.assertRaisesRegex(ValueError, "b'foo' -> b'bar'"): | self.assertEqual( | ||||
Snapshot.from_dict(remove_id(self.unresolved)) | Snapshot.from_dict(remove_id(self.unresolved)).id, self.unresolved["id"] | ||||
) | |||||
def test_git_object_unresolved(self): | def test_git_object_unresolved(self): | ||||
with self.assertRaisesRegex(ValueError, "b'foo' -> b'bar'"): | with self.assertRaisesRegex(ValueError, "b'foo' -> b'bar'"): | ||||
git_objects.snapshot_git_object(self.unresolved) | git_objects.snapshot_git_object(self.unresolved) | ||||
git_objects.snapshot_git_object(self.unresolved, ignore_unresolved=True) | git_objects.snapshot_git_object(self.unresolved, ignore_unresolved=True) | ||||
def test_all_types(self): | def test_all_types(self): | ||||
self.assertEqual( | self.assertEqual( | ||||
▲ Show 20 Lines • Show All 577 Lines • Show Last 20 Lines |