Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-scrubber
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
Pierre-Yves David
swh-scrubber
Commits
0ef7e397
Verified
Commit
0ef7e397
authored
1 year ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
scrubber.cli: Fix raised exception typo
This was found while deploying the new version.
parent
53970d52
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
swh/scrubber/cli.py
+2
-2
2 additions, 2 deletions
swh/scrubber/cli.py
swh/scrubber/tests/test_cli.py
+7
-0
7 additions, 0 deletions
swh/scrubber/tests/test_cli.py
with
9 additions
and
2 deletions
swh/scrubber/cli.py
+
2
−
2
View file @
0ef7e397
# Copyright (C) 2022 The Software Heritage developers
# Copyright (C) 2022
-2023
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
...
...
@@ -315,7 +315,7 @@ def scrubber_check_storage(
config_id
=
db
.
config_get_by_name
(
name
)
if
config_id
is
None
:
raise
click
.
ClickExcepti
n
o
(
"
A valid configuration name/id must be set
"
)
raise
click
.
ClickExceptio
n
(
"
A valid configuration name/id must be set
"
)
checker
=
StorageChecker
(
db
=
ctx
.
obj
[
"
db
"
],
storage
=
get_storage
(
**
conf
[
"
storage
"
]),
...
...
This diff is collapsed.
Click to expand it.
swh/scrubber/tests/test_cli.py
+
7
−
0
View file @
0ef7e397
...
...
@@ -199,6 +199,13 @@ def test_check_storage(mocker, scrubber_db, swh_storage):
assert
result
.
output
==
""
def
test_check_storage_ko
(
mocker
,
scrubber_db
,
swh_storage
):
# using the config id instead of the config name
result
=
invoke
(
scrubber_db
,
[
"
check
"
,
"
storage
"
],
storage
=
swh_storage
)
assert
result
.
exit_code
==
1
,
result
.
output
assert
result
.
output
==
"
Error: A valid configuration name/id must be set
\n
"
def
test_check_list
(
mocker
,
scrubber_db
,
swh_storage
):
mocker
.
patch
(
"
swh.scrubber.get_scrubber_db
"
,
return_value
=
scrubber_db
)
result
=
invoke
(
scrubber_db
,
[
"
check
"
,
"
list
"
],
storage
=
swh_storage
)
...
...
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