Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/test_in_memory.py
# Copyright (C) 2018 The Software Heritage developers | # Copyright (C) 2018 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import unittest | import unittest | ||||
import pytest | import pytest | ||||
from swh.storage.in_memory import Storage, ENABLE_ORIGIN_IDS | from swh.storage.in_memory import Storage, ENABLE_ORIGIN_IDS | ||||
from swh.storage.tests.test_storage import \ | from swh.storage.tests.test_storage import ( | ||||
CommonTestStorage, CommonPropTestStorage | TestStorage as _TestStorage, | ||||
TestStorageCommonProp as _TestStorageCommonProp) | |||||
class TestInMemoryStorage(CommonTestStorage, unittest.TestCase): | @pytest.mark.xfail | ||||
class TestInMemoryStorage(_TestStorage, unittest.TestCase): | |||||
"""Test the in-memory storage API | """Test the in-memory storage API | ||||
This class doesn't define any tests as we want identical | This class doesn't define any tests as we want identical | ||||
functionality between local and remote storage. All the tests are | functionality between local and remote storage. All the tests are | ||||
therefore defined in CommonTestStorage. | therefore defined in CommonTestStorage. | ||||
""" | """ | ||||
_test_origin_ids = ENABLE_ORIGIN_IDS | _test_origin_ids = ENABLE_ORIGIN_IDS | ||||
Show All 26 Lines | if not _test_origin_ids: | ||||
def test_origin_metadata_get_by_provider_type(self): | def test_origin_metadata_get_by_provider_type(self): | ||||
pass | pass | ||||
def reset_storage(self): | def reset_storage(self): | ||||
self.storage = Storage(journal_writer={'cls': 'memory'}) | self.storage = Storage(journal_writer={'cls': 'memory'}) | ||||
self.journal_writer = self.storage.journal_writer | self.journal_writer = self.storage.journal_writer | ||||
@pytest.mark.xfail | |||||
@pytest.mark.property_based | @pytest.mark.property_based | ||||
class PropTestInMemoryStorage(CommonPropTestStorage, unittest.TestCase): | class PropTestInMemoryStorage(_TestStorageCommonProp, unittest.TestCase): | ||||
"""Test the in-memory storage API | """Test the in-memory storage API | ||||
This class doesn't define any tests as we want identical | This class doesn't define any tests as we want identical | ||||
functionality between local and remote storage. All the tests are | functionality between local and remote storage. All the tests are | ||||
therefore defined in CommonPropTestStorage. | therefore defined in CommonPropTestStorage. | ||||
""" | """ | ||||
_test_origin_ids = ENABLE_ORIGIN_IDS | _test_origin_ids = ENABLE_ORIGIN_IDS | ||||
Show All 11 Lines |