Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_origin_head.py
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | def test_git(self): | ||||
'revision_id': b'8K\x12\x00d\x03\xcc\xe4]bS\xe3\x8f{' | 'revision_id': b'8K\x12\x00d\x03\xcc\xe4]bS\xe3\x8f{' | ||||
b'\xd7}\xac\xefrm', | b'\xd7}\xac\xefrm', | ||||
'origin_url': 'https://github.com/SoftwareHeritage/swh-storage'}]) | 'origin_url': 'https://github.com/SoftwareHeritage/swh-storage'}]) | ||||
def test_git_partial_snapshot(self): | def test_git_partial_snapshot(self): | ||||
"""Checks partial snapshots are ignored.""" | """Checks partial snapshots are ignored.""" | ||||
origin_url = 'https://github.com/SoftwareHeritage/swh-core' | origin_url = 'https://github.com/SoftwareHeritage/swh-core' | ||||
self.indexer.storage.origin_add_one({ | self.indexer.storage.origin_add_one({ | ||||
'type': 'git', | |||||
'url': origin_url, | 'url': origin_url, | ||||
}) | }) | ||||
visit = self.indexer.storage.origin_visit_add( | visit = self.indexer.storage.origin_visit_add( | ||||
origin_url, '2019-02-27') | origin_url, '2019-02-27', type='git', | ||||
) | |||||
self.indexer.storage.snapshot_add([{ | self.indexer.storage.snapshot_add([{ | ||||
'id': b'foo', | 'id': b'foo', | ||||
'branches': { | 'branches': { | ||||
b'foo': None, | b'foo': None, | ||||
b'HEAD': { | b'HEAD': { | ||||
'target_type': 'alias', | 'target_type': 'alias', | ||||
'target': b'foo', | 'target': b'foo', | ||||
} | } | ||||
Show All 11 Lines | def test_vcs_missing_snapshot(self): | ||||
}]) | }]) | ||||
self.indexer.run( | self.indexer.run( | ||||
['https://github.com/SoftwareHeritage/swh-indexer']) | ['https://github.com/SoftwareHeritage/swh-indexer']) | ||||
self.assertEqual(self.indexer.results, []) | self.assertEqual(self.indexer.results, []) | ||||
def test_pypi_missing_branch(self): | def test_pypi_missing_branch(self): | ||||
origin_url = 'https://pypi.org/project/abcdef/' | origin_url = 'https://pypi.org/project/abcdef/' | ||||
self.indexer.storage.origin_add_one({ | self.indexer.storage.origin_add_one({ | ||||
'type': 'pypi', | |||||
'url': origin_url, | 'url': origin_url, | ||||
}) | }) | ||||
visit = self.indexer.storage.origin_visit_add( | visit = self.indexer.storage.origin_visit_add( | ||||
origin_url, '2019-02-27') | origin_url, '2019-02-27', type='pypi') | ||||
self.indexer.storage.snapshot_add([{ | self.indexer.storage.snapshot_add([{ | ||||
'id': b'foo', | 'id': b'foo', | ||||
'branches': { | 'branches': { | ||||
b'foo': None, | b'foo': None, | ||||
b'HEAD': { | b'HEAD': { | ||||
'target_type': 'alias', | 'target_type': 'alias', | ||||
'target': b'foo', | 'target': b'foo', | ||||
} | } | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |