core: run ruff format

This commit is contained in:
RhodeCode Admin 2025-01-13 17:47:37 +01:00
parent 7130effb58
commit 166db21812
821 changed files with 82905 additions and 84121 deletions

View file

@ -20,8 +20,7 @@
import pytest
from rhodecode.tests import TEST_USER_ADMIN_LOGIN
from rhodecode.api.tests.utils import (
build_data, api_call, assert_error)
from rhodecode.api.tests.utils import build_data, api_call, assert_error
@pytest.mark.usefixtures("testuser_api", "app")
@ -30,9 +29,9 @@ class TestApiGetGist(object):
gist_util.create_gist()
gist_util.create_gist()
id_, params = build_data(self.apikey, 'get_gists')
id_, params = build_data(self.apikey, "get_gists")
response = api_call(self.app, params)
assert len(response.json['result']) == 2
assert len(response.json["result"]) == 2
def test_api_get_gists_regular_user(self, gist_util):
# by admin
@ -44,9 +43,9 @@ class TestApiGetGist(object):
gist_util.create_gist(owner=self.TEST_USER_LOGIN)
gist_util.create_gist(owner=self.TEST_USER_LOGIN)
id_, params = build_data(self.apikey_regular, 'get_gists')
id_, params = build_data(self.apikey_regular, "get_gists")
response = api_call(self.app, params)
assert len(response.json['result']) == 3
assert len(response.json["result"]) == 3
def test_api_get_gists_only_for_regular_user(self, gist_util):
# by admin
@ -58,15 +57,12 @@ class TestApiGetGist(object):
gist_util.create_gist(owner=self.TEST_USER_LOGIN)
gist_util.create_gist(owner=self.TEST_USER_LOGIN)
id_, params = build_data(
self.apikey, 'get_gists', userid=self.TEST_USER_LOGIN)
id_, params = build_data(self.apikey, "get_gists", userid=self.TEST_USER_LOGIN)
response = api_call(self.app, params)
assert len(response.json['result']) == 3
assert len(response.json["result"]) == 3
def test_api_get_gists_regular_user_with_different_userid(self):
id_, params = build_data(
self.apikey_regular, 'get_gists',
userid=TEST_USER_ADMIN_LOGIN)
id_, params = build_data(self.apikey_regular, "get_gists", userid=TEST_USER_ADMIN_LOGIN)
response = api_call(self.app, params)
expected = 'userid is not the same as your user'
expected = "userid is not the same as your user"
assert_error(id_, expected, given=response.body)