diff --git a/src/modules/external/yandexgpt/yandexgpt.py b/src/modules/external/yandexgpt/yandexgpt.py index 1658e0d..1d726d6 100644 --- a/src/modules/external/yandexgpt/yandexgpt.py +++ b/src/modules/external/yandexgpt/yandexgpt.py @@ -99,7 +99,7 @@ class YandexGPT: "messages": messages, } - response = requests.post(url, headers=headers, json=prompt).text + response = requests.post(url, headers=headers, json=prompt).text # nosec return json.loads(response)["result"]["alternatives"][0]["message"]["text"] async def async_yandexgpt( @@ -135,7 +135,9 @@ class YandexGPT: }, "messages": messages, } - response = await self.async_request(url=url, headers=headers, prompt=request) + response = await self.async_request( + url=url, headers=headers, prompt=request + ) # nosec return response["result"]["alternatives"][0]["message"]["text"] async def async_yandexgpt_translate(self, input_language, output_language, text): @@ -187,7 +189,7 @@ class YandexGPT: "messages": messages, } - response = requests.post(url, headers=headers, json=prompt).text + response = requests.post(url, headers=headers, json=prompt).text # nosec return json.loads(response)["result"]["alternatives"][0]["message"]["text"] async def async_yandex_cloud_text_to_speech( diff --git a/src/modules/standard/config/tests/test_config.py b/src/modules/standard/config/tests/test_config.py index a71ce52..011d5c1 100644 --- a/src/modules/standard/config/tests/test_config.py +++ b/src/modules/standard/config/tests/test_config.py @@ -33,7 +33,7 @@ class TestConfig(unittest.TestCase): ) def test_yaml_values(self): - expected_token = "xxxxxxxxxxxxxxxxxxxx" + expected_token = "xxxxxxxxxxxxxxxxxxxx" # nosec expected_role_values = {"ADMIN": 0, "MODERATOR": 1, "USER": 2, "BOT": 3} self.assertEqual(yaml_load["TELEGRAM"]["TOKEN"], expected_token) diff --git a/src/modules/standard/database/tests/test_db.py b/src/modules/standard/database/tests/test_db.py index fd47d9b..0052a7e 100644 --- a/src/modules/standard/database/tests/test_db.py +++ b/src/modules/standard/database/tests/test_db.py @@ -135,7 +135,7 @@ class TestDatabaseAPI(unittest.TestCase): @classmethod def tearDownClass(cls): cls.database.close() - os.system(f"rm {cls.path}") + os.system(f"rm {cls.path}") # nosec if __name__ == "__main__": diff --git a/src/modules/standard/roles/tests/test_roles.py b/src/modules/standard/roles/tests/test_roles.py index 7a7c85e..4828306 100644 --- a/src/modules/standard/roles/tests/test_roles.py +++ b/src/modules/standard/roles/tests/test_roles.py @@ -73,7 +73,7 @@ class TestRoles(unittest.IsolatedAsyncioTestCase): @classmethod def tearDownClass(cls): cls.database.close() - os.system(f"rm {cls.path}") + os.system(f"rm {cls.path}") # nosec if __name__ == "__main__": diff --git a/src/modules/standard/welcome/handlers.py b/src/modules/standard/welcome/handlers.py index 5a1af77..16102b9 100644 --- a/src/modules/standard/welcome/handlers.py +++ b/src/modules/standard/welcome/handlers.py @@ -16,13 +16,13 @@ from src.modules.standard.roles.roles import Roles async def create_math_task(): - first_number = random.randint(1, 100) - second_number = random.randint(1, 100) + first_number = random.randint(1, 100) # nosec + second_number = random.randint(1, 100) # nosec answer = first_number + second_number fake_answers = [] for i in range(3): - diff = random.randint(1, 10) - diff_sign = random.choice(["+", "-"]) + diff = random.randint(1, 10) # nosec + diff_sign = random.choice(["+", "-"]) # nosec fake_answers.append(answer + diff if diff_sign == "+" else answer - diff) fake_answers.append(answer) random.shuffle(fake_answers)