Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Base Worker
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
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
Workers
Base Worker
Commits
b5c62f46
Verified
Commit
b5c62f46
authored
2 years ago
by
Yoann Schneider
Browse files
Options
Downloads
Patches
Plain Diff
match post data sent
parent
38f214c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!112
Bump Python requirement python-gitlab to 3.9.0
Pipeline
#79450
passed
2 years ago
Stage: test
Stage: build
Stage: release
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_git.py
+4
-1
4 additions, 1 deletion
tests/test_git.py
with
4 additions
and
1 deletion
tests/test_git.py
+
4
−
1
View file @
b5c62f46
...
...
@@ -4,6 +4,7 @@ from pathlib import Path
import
pytest
from
gitlab
import
GitlabCreateError
,
GitlabError
from
requests
import
ConnectionError
from
responses
import
matchers
from
arkindex_worker.git
import
GitlabHelper
...
...
@@ -222,6 +223,7 @@ def test_merge_request(fake_responses, fake_gitlab_helper_factory, mocker):
"
state
"
:
"
merged
"
,
# several fields omitted
},
match
=
[
matchers
.
json_params_matcher
({
"
should_remove_source_branch
"
:
True
})],
)
# the fake_responses are defined in the same order as they are expected to be called
...
...
@@ -233,7 +235,6 @@ def test_merge_request(fake_responses, fake_gitlab_helper_factory, mocker):
gitlab_helper
.
_wait_for_rebase_to_finish
.
return_value
=
True
success
=
gitlab_helper
.
merge
(
SOURCE_BRANCH
,
MR_TITLE
)
assert
success
assert
len
(
fake_responses
.
calls
)
==
4
assert
[
c
.
request
.
method
for
c
in
fake_responses
.
calls
]
==
expected_http_methods
...
...
@@ -258,6 +259,7 @@ def test_merge_request_fail(fake_responses, fake_gitlab_helper_factory, mocker):
f
"
https://gitlab.com/api/v4/projects/
{
PROJECT_ID
}
/merge_requests/
{
MERGE_REQUEST_ID
}
/merge
"
,
json
=
{
"
error
"
:
"
Method not allowed
"
},
status
=
405
,
match
=
[
matchers
.
json_params_matcher
({
"
should_remove_source_branch
"
:
True
})],
)
# the fake_responses are defined in the same order as they are expected to be called
...
...
@@ -346,6 +348,7 @@ def test_merge_request__success_after_errors(
"
state
"
:
"
merged
"
,
# several fields omitted
},
match
=
[
matchers
.
json_params_matcher
({
"
should_remove_source_branch
"
:
True
})],
)
# the fake_responses are defined in the same order as they are expected to be called
...
...
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