Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9123571
test_postgresql_flavor_mirror.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
test_postgresql_flavor_mirror.py
View Options
# Copyright (C) 2022 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from
functools
import
partial
import
pytest
from
pytest_postgresql
import
factories
from
swh.core.db.db_utils
import
initialize_database_for_module
from
swh.storage.postgresql.storage
import
Storage
as
StorageDatastore
from
swh.storage.tests.test_postgresql
import
TestPgStorage
# noqa: F401
from
swh.storage.tests.test_postgresql
import
TestStorage
# noqa: F401
from
swh.storage.tests.test_postgresql
import
TestStorageRaceConditions
# noqa: F401
swh_storage_postgresql_proc
=
factories
.
postgresql_proc
(
load
=
[
partial
(
initialize_database_for_module
,
modname
=
"storage"
,
flavor
=
"mirror"
,
version
=
StorageDatastore
.
current_version
,
)
],
)
@pytest.mark.db
def
test_pgstorage_flavor
(
swh_storage
):
# get_flavor retrieve directly from the db
assert
swh_storage
.
get_flavor
()
==
"mirror"
# flavor property (value is cached)
assert
swh_storage
.
_flavor
is
None
assert
swh_storage
.
flavor
==
"mirror"
assert
swh_storage
.
_flavor
==
"mirror"
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Sat, Jun 21, 5:42 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3239637
Attached To
rDSTO Storage manager
Event Timeline
Log In to Comment