Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9314262
test_revision_iterator.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
973 B
Subscribers
None
test_revision_iterator.py
View Options
# Copyright (C) 2021 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.provenance.revision
import
CSVRevisionIterator
from
swh.provenance.tests.conftest
import
fill_storage
,
load_repo_data
from
swh.provenance.tests.test_provenance_db
import
ts2dt
@pytest.mark.parametrize
(
"repo"
,
(
"cmdbts2"
,
"out-of-order"
,
),
)
def
test_archive_direct_revision_iterator
(
swh_storage
,
repo
):
"""Test CSVRevisionIterator"""
data
=
load_repo_data
(
repo
)
fill_storage
(
swh_storage
,
data
)
revisions_csv
=
[
(
rev
[
"id"
],
ts2dt
(
rev
[
"date"
])
.
isoformat
(),
rev
[
"directory"
])
for
rev
in
data
[
"revision"
]
]
revisions
=
list
(
CSVRevisionIterator
(
revisions_csv
))
assert
revisions
assert
len
(
revisions
)
==
len
(
data
[
"revision"
])
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Thu, Jul 3, 12:19 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3271309
Attached To
rDPROV Provenance database
Event Timeline
Log In to Comment