Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/common/test_service.py
Show First 20 Lines • Show All 657 Lines • ▼ Show 20 Lines | def test_lookup_content_with_sha256(self, content): | ||||
actual_content = service.lookup_content( | actual_content = service.lookup_content( | ||||
'sha256:%s' % content['sha256']) | 'sha256:%s' % content['sha256']) | ||||
expected_content = self.content_get_metadata(content['sha1']) | expected_content = self.content_get_metadata(content['sha1']) | ||||
self.assertEqual(actual_content, expected_content) | self.assertEqual(actual_content, expected_content) | ||||
@given(revision()) | |||||
def test_lookup_person(self, revision): | |||||
rev_data = self.revision_get(revision) | |||||
actual_person = service.lookup_person(rev_data['author']['id']) | |||||
self.assertEqual(actual_person, rev_data['author']) | |||||
def test_lookup_directory_bad_checksum(self): | def test_lookup_directory_bad_checksum(self): | ||||
with self.assertRaises(BadInputExc): | with self.assertRaises(BadInputExc): | ||||
service.lookup_directory('directory_id') | service.lookup_directory('directory_id') | ||||
def test_lookup_directory_not_found(self): | def test_lookup_directory_not_found(self): | ||||
unknown_directory_ = random_sha1() | unknown_directory_ = random_sha1() | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |