Skip to content

Commit

Permalink
chore: make latest black happy with existing code
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksii Shkurupii authored and Oleksii Shkurupii committed Aug 29, 2020
1 parent 1317f4b commit 6961479
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 10 deletions.
8 changes: 7 additions & 1 deletion gitlab/tests/objects/test_commits.py
Expand Up @@ -88,7 +88,13 @@ def test_create_commit(project, resp_create_commit):
data = {
"branch": "master",
"commit_message": "Commit message",
"actions": [{"action": "create", "file_path": "README", "content": "",}],
"actions": [
{
"action": "create",
"file_path": "README",
"content": "",
}
],
}
commit = project.commits.create(data)
assert commit.short_id == "ed899a2f"
Expand Down
12 changes: 9 additions & 3 deletions gitlab/tests/objects/test_runners.py
Expand Up @@ -167,7 +167,9 @@ def resp_runner_delete():
status=200,
)
rsps.add(
method=responses.DELETE, url=pattern, status=204,
method=responses.DELETE,
url=pattern,
status=204,
)
yield rsps

Expand All @@ -177,7 +179,9 @@ def resp_runner_disable():
with responses.RequestsMock() as rsps:
pattern = re.compile(r".*?/(groups|projects)/1/runners/6")
rsps.add(
method=responses.DELETE, url=pattern, status=204,
method=responses.DELETE,
url=pattern,
status=204,
)
yield rsps

Expand All @@ -187,7 +191,9 @@ def resp_runner_verify():
with responses.RequestsMock() as rsps:
pattern = re.compile(r".*?/runners/verify")
rsps.add(
method=responses.POST, url=pattern, status=200,
method=responses.POST,
url=pattern,
status=200,
)
yield rsps

Expand Down
26 changes: 21 additions & 5 deletions gitlab/v4/objects.py
Expand Up @@ -711,8 +711,14 @@ class ProjectDeployTokenManager(ListMixin, CreateMixin, DeleteMixin, RESTManager
_from_parent_attrs = {"project_id": "id"}
_obj_cls = ProjectDeployToken
_create_attrs = (
("name", "scopes",),
("expires_at", "username",),
(
"name",
"scopes",
),
(
"expires_at",
"username",
),
)


Expand All @@ -725,8 +731,14 @@ class GroupDeployTokenManager(ListMixin, CreateMixin, DeleteMixin, RESTManager):
_from_parent_attrs = {"group_id": "id"}
_obj_cls = GroupDeployToken
_create_attrs = (
("name", "scopes",),
("expires_at", "username",),
(
"name",
"scopes",
),
(
"expires_at",
"username",
),
)


Expand Down Expand Up @@ -4205,7 +4217,11 @@ class ProjectServiceManager(GetMixin, UpdateMixin, DeleteMixin, ListMixin, RESTM
),
),
"jira": (
("url", "username", "password",),
(
"url",
"username",
"password",
),
(
"api_url",
"active",
Expand Down
7 changes: 6 additions & 1 deletion tools/python_test_v4.py
Expand Up @@ -701,7 +701,12 @@

# Remove once https://gitlab.com/gitlab-org/gitlab/-/issues/211878 is fixed
deploy_token = deploy_token_group.deploytokens.create(
{"name": "foo", "username": "", "expires_at": "", "scopes": ["read_repository"],}
{
"name": "foo",
"username": "",
"expires_at": "",
"scopes": ["read_repository"],
}
)

assert len(deploy_token_group.deploytokens.list()) == 1
Expand Down

0 comments on commit 6961479

Please sign in to comment.