Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/testcase.py
Show All 31 Lines | class WebTestCase(TestCase): | ||||
""" | """ | ||||
def _pre_setup(self): | def _pre_setup(self): | ||||
cache.clear() | cache.clear() | ||||
tests_data = get_tests_data(reset=True) | tests_data = get_tests_data(reset=True) | ||||
self.storage = tests_data['storage'] | self.storage = tests_data['storage'] | ||||
self.idx_storage = tests_data['idx_storage'] | self.idx_storage = tests_data['idx_storage'] | ||||
self.search = tests_data['search'] | |||||
self.mimetype_indexer = tests_data['mimetype_indexer'] | self.mimetype_indexer = tests_data['mimetype_indexer'] | ||||
self.license_indexer = tests_data['license_indexer'] | self.license_indexer = tests_data['license_indexer'] | ||||
self.ctags_indexer = tests_data['ctags_indexer'] | self.ctags_indexer = tests_data['ctags_indexer'] | ||||
# Update swh-web configuration to use the in-memory storages | # Update swh-web configuration to use the in-memory storages | ||||
# instantiated in the tests.data module | # instantiated in the tests.data module | ||||
override_storages(tests_data['storage'], tests_data['idx_storage']) | override_storages( | ||||
tests_data['storage'], tests_data['idx_storage'], | |||||
tests_data['search']) | |||||
super()._pre_setup() | super()._pre_setup() | ||||
def content_add_mimetype(self, cnt_id): | def content_add_mimetype(self, cnt_id): | ||||
self.mimetype_indexer.run([hash_to_bytes(cnt_id)], | self.mimetype_indexer.run([hash_to_bytes(cnt_id)], | ||||
'update-dups') | 'update-dups') | ||||
def content_get_mimetype(self, cnt_id): | def content_get_mimetype(self, cnt_id): | ||||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |