Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-lister
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Dandrimont
swh-lister
Commits
4504ecc1
Commit
4504ecc1
authored
2 years ago
by
Jenkins for Software Heritage
Browse files
Options
Downloads
Plain Diff
New upstream version 4.3.3
parents
926f413d
bcf30aba
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
PKG-INFO
+1
-1
1 addition, 1 deletion
PKG-INFO
docs/index.rst
+9
-1
9 additions, 1 deletion
docs/index.rst
swh.lister.egg-info/PKG-INFO
+1
-1
1 addition, 1 deletion
swh.lister.egg-info/PKG-INFO
swh/lister/github/tests/test_lister.py
+16
-14
16 additions, 14 deletions
swh/lister/github/tests/test_lister.py
with
27 additions
and
17 deletions
PKG-INFO
+
1
−
1
View file @
4504ecc1
Metadata-Version: 2.1
Name: swh.lister
Version: 4.3.
1
Version: 4.3.
3
Summary: Software Heritage lister
Home-page: https://forge.softwareheritage.org/diffusion/DLSGH/
Author: Software Heritage developers
...
...
This diff is collapsed.
Click to expand it.
docs/index.rst
+
9
−
1
View file @
4504ecc1
...
...
@@ -29,4 +29,12 @@ Reference Documentation
:maxdepth: 2
cli
/apidoc/swh.lister
.. only:: standalone_package_doc
Indices and tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
This diff is collapsed.
Click to expand it.
swh.lister.egg-info/PKG-INFO
+
1
−
1
View file @
4504ecc1
Metadata-Version: 2.1
Name: swh.lister
Version: 4.3.
1
Version: 4.3.
3
Summary: Software Heritage lister
Home-page: https://forge.softwareheritage.org/diffusion/DLSGH/
Author: Software Heritage developers
...
...
This diff is collapsed.
Click to expand it.
swh/lister/github/tests/test_lister.py
+
16
−
14
View file @
4504ecc1
...
...
@@ -5,10 +5,9 @@
import
datetime
import
logging
from
typing
import
Any
,
Dict
,
Iterator
,
List
from
typing
import
Any
,
Dict
,
List
import
pytest
import
requests_mock
from
swh.core.github.pytest_plugin
import
github_response_callback
from
swh.lister.github.lister
import
GitHubLister
...
...
@@ -20,11 +19,13 @@ NUM_PAGES = 10
ORIGIN_COUNT
=
GitHubLister
.
PAGE_SIZE
*
NUM_PAGES
def
response_callback
(
request
,
context
):
return
github_response_callback
(
request
,
context
,
remaining_requests
=
1000
)
@pytest.fixture
()
def
requests_mocker
()
->
Iterator
[
requests_mock
.
Mocker
]:
with
requests_mock
.
Mocker
()
as
mock
:
mock
.
get
(
GitHubLister
.
API_URL
,
json
=
github_response_callback
)
yield
mock
def
requests_mocker
(
requests_mock
):
requests_mock
.
get
(
GitHubLister
.
API_URL
,
json
=
response_callback
)
def
get_lister_data
(
swh_scheduler
:
SchedulerInterface
)
->
Lister
:
...
...
@@ -65,9 +66,7 @@ def check_origin_5555(swh_scheduler: SchedulerInterface, lister: Lister) -> None
assert
origin_5555
.
last_update
is
None
def
test_from_empty_state
(
swh_scheduler
,
caplog
,
requests_mocker
:
requests_mock
.
Mocker
)
->
None
:
def
test_from_empty_state
(
swh_scheduler
,
caplog
,
requests_mocker
)
->
None
:
caplog
.
set_level
(
logging
.
DEBUG
,
"
swh.lister.github.lister
"
)
# Run the lister in incremental mode
...
...
@@ -137,7 +136,9 @@ def test_relister(swh_scheduler, caplog, requests_mocker) -> None:
assert
lister_data
.
current_state
==
{
"
last_seen_id
"
:
123
}
def
test_anonymous_ratelimit
(
swh_scheduler
,
caplog
,
requests_ratelimited
)
->
None
:
def
test_anonymous_ratelimit
(
swh_scheduler
,
caplog
,
github_requests_ratelimited
)
->
None
:
caplog
.
set_level
(
logging
.
DEBUG
,
"
swh.core.github.utils
"
)
lister
=
GitHubLister
(
scheduler
=
swh_scheduler
)
...
...
@@ -179,7 +180,7 @@ def test_authenticated_credentials(
def
test_ratelimit_once_recovery
(
swh_scheduler
,
caplog
,
requests_ratelimited
,
github_
requests_ratelimited
,
num_ratelimit
,
monkeypatch_sleep_calls
,
lister_credentials
,
...
...
@@ -214,12 +215,13 @@ def test_ratelimit_once_recovery(
def
test_ratelimit_reset_sleep
(
swh_scheduler
,
caplog
,
requests_ratelimited
,
github_
requests_ratelimited
,
monkeypatch_sleep_calls
,
num_before_ratelimit
,
ratelimit_reset
,
github_credentials
,
lister_credentials
,
num_before_ratelimit
,
num_ratelimit
,
ratelimit_reset
,
):
"""
Check that the lister properly handles rate-limiting when providing it with
authentication tokens
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment