From 91bc00c24a31378040c99da014c08ea62d116936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20Syrj=C3=A4salo?= Date: Mon, 29 Jul 2024 12:22:32 +0300 Subject: [PATCH] refactor(REST): Sort imports --- src/REST/__init__.py | 10 ++++------ src/REST/keywords.py | 18 +++++++----------- test/test_keywords.py | 1 + test/test_output.py | 5 +++-- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/REST/__init__.py b/src/REST/__init__.py index f16bd5c..0e1779d 100644 --- a/src/REST/__init__.py +++ b/src/REST/__init__.py @@ -5,17 +5,15 @@ # Licensed under GNU Lesser General Public License v3 (LGPL-3.0). from io import open - from json import dumps, load, loads from os import path -from yaml import load as load_yaml, SafeLoader - -from pygments import highlight, lexers, formatters -from requests.packages.urllib3 import disable_warnings - from urllib.parse import urlparse +from pygments import formatters, highlight, lexers +from requests.packages.urllib3 import disable_warnings from robot.api import logger +from yaml import SafeLoader +from yaml import load as load_yaml from .keywords import Keywords from .version import __version__ diff --git a/src/REST/keywords.py b/src/REST/keywords.py index 8b33c42..652e491 100644 --- a/src/REST/keywords.py +++ b/src/REST/keywords.py @@ -4,31 +4,27 @@ # Copyright(C) 2018- Anssi Syrjäsalo (http://a.syrjasalo.com) # Licensed under GNU Lesser General Public License v3 (LGPL-3.0). -from io import open - -from pytz import utc, UnknownTimeZoneError -from tzlocal import get_localzone - from collections import OrderedDict from copy import deepcopy from datetime import datetime +from io import open from json import dumps -from os import path, getcwd +from os import getcwd, path +from urllib.parse import parse_qsl, urljoin, urlparse from flex.core import validate_api_call from genson import SchemaBuilder from jsonpath_ng.ext import parse as parse_jsonpath -from jsonschema import validate, FormatChecker +from jsonschema import FormatChecker, validate from jsonschema.exceptions import SchemaError, ValidationError +from pytz import UnknownTimeZoneError, utc from requests import request as client -from requests.auth import HTTPDigestAuth, HTTPBasicAuth, HTTPProxyAuth +from requests.auth import HTTPBasicAuth, HTTPDigestAuth, HTTPProxyAuth from requests.exceptions import SSLError, Timeout - -from urllib.parse import parse_qsl, urljoin, urlparse - from robot.api import logger from robot.api.deco import keyword from robot.libraries.BuiltIn import BuiltIn, RobotNotRunningError +from tzlocal import get_localzone from .schema_keywords import SCHEMA_KEYWORDS diff --git a/test/test_keywords.py b/test/test_keywords.py index 5f84238..efb5916 100644 --- a/test/test_keywords.py +++ b/test/test_keywords.py @@ -1,5 +1,6 @@ import unittest from unittest.mock import MagicMock + from src import REST diff --git a/test/test_output.py b/test/test_output.py index 3fd8f57..5d640a1 100644 --- a/test/test_output.py +++ b/test/test_output.py @@ -1,10 +1,11 @@ +import io import os import re -import unittest import sys +import unittest from unittest.mock import MagicMock, mock_open, patch + from src import REST -import io class TestOutputLogJsonCalling(unittest.TestCase):