Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
2a59e1bc
Commit
2a59e1bc
authored
3 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[test] Introduce click context helper
parent
cdc59c7f
No related branches found
No related tags found
1 merge request
!193
#409: Improve endpoint determination code layer
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/helpers.py
+26
-0
26 additions, 0 deletions
tests/helpers.py
with
26 additions
and
0 deletions
tests/helpers.py
0 → 100644
+
26
−
0
View file @
2a59e1bc
# Copyright 2016-2021 Maël Azimi <m.a@moul.re>
#
# Silkaj is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Silkaj is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Silkaj. If not, see <https://www.gnu.org/licenses/>.
import
click
from
silkaj
import
cli
def
define_click_context
(
endpoint
=
None
,
gtest
=
False
):
ctx
=
click
.
Context
(
cli
.
cli
)
ctx
.
obj
=
dict
()
ctx
.
obj
[
"
ENDPOINT
"
]
=
endpoint
ctx
.
obj
[
"
GTEST
"
]
=
gtest
click
.
globals
.
push_context
(
ctx
)
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