Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9314222
test_utils.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
719 B
Subscribers
None
test_utils.py
View Options
# Copyright (C) 2020 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
import
pytest
from
swh.dataset.utils
import
LevelDBSet
,
SQLiteSet
@pytest.fixture
(
params
=
[
SQLiteSet
,
LevelDBSet
])
def
diskset
(
request
,
tmp_path
):
backend
=
request
.
param
return
backend
(
tmp_path
/
"test"
)
def
test_diskset
(
diskset
):
with
diskset
as
s
:
assert
s
.
add
(
b
"a"
)
assert
s
.
add
(
b
"b"
)
assert
not
s
.
add
(
b
"a"
)
assert
s
.
add
(
b
"c"
)
assert
not
s
.
add
(
b
"b"
)
assert
not
s
.
add
(
b
"c"
)
assert
not
s
.
add
(
b
"c"
)
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Thu, Jul 3, 12:16 PM (13 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3240454
Attached To
rDDATASET Datasets
Event Timeline
Log In to Comment