isort + black

This commit is contained in:
Trinh Anh Ngoc
2023-05-18 21:34:00 +07:00
parent 0aa797dda6
commit c08982b281
62 changed files with 1804 additions and 573 deletions

View File

@@ -10,8 +10,6 @@ from xmlrpc import client as xmlrpclib
import requests
from websocket import WebSocket
from . import case
from .result import OdooTestResult
from ..api import Environment
from ..http import Session
from ..models import BaseModel
@@ -20,9 +18,11 @@ from ..sql_db import BaseCursor, Cursor
from ..tools import profiler
from ..tools._vendor.sessions import Session
from ..tools.profiler import Profiler
from . import case
from .result import OdooTestResult
_T = TypeVar('_T')
_CallableT = TypeVar('_CallableT', bound=Callable)
_T = TypeVar("_T")
_CallableT = TypeVar("_CallableT", bound=Callable)
InvalidStateError = Any
ADDONS_PATH: str
@@ -40,7 +40,13 @@ def standalone(*tags: str) -> Callable[[_CallableT], _CallableT]: ...
DB: str
def new_test_user(env: Environment, login: str = ..., groups: str = ..., context: dict | None = ..., **kwargs) -> 'odoo.model.res_users': ...
def new_test_user(
env: Environment,
login: str = ...,
groups: str = ...,
context: dict | None = ...,
**kwargs
) -> "odoo.model.res_users": ...
class RecordCapturer:
_model: BaseModel
@@ -82,14 +88,26 @@ class BaseCase(case.TestCase, metaclass=MetaCase):
def startClassPatcher(cls, patcher): ...
def with_user(self, login: str) -> None: ...
def debug_mode(self) -> Generator[None, None, None]: ...
def _assertRaises(self, exception, *, msg: Any | None = ...) -> Generator[Any, None, None]: ...
def assertRaises(self, exception, func: Any | None = ..., *args, **kwargs) -> Generator[Any, None, None] | None: ...
def assertQueries(self, expected, flush: bool = ...) -> Generator[list, None, None]: ...
def assertQueryCount(self, default: int = ..., flush: bool = ..., **counters) -> Generator[None, None, None]: ...
def assertRecordValues(self, records: BaseModel, expected_values: list[dict[str, Any]]) -> None: ...
def _assertRaises(
self, exception, *, msg: Any | None = ...
) -> Generator[Any, None, None]: ...
def assertRaises(
self, exception, func: Any | None = ..., *args, **kwargs
) -> Generator[Any, None, None] | None: ...
def assertQueries(
self, expected, flush: bool = ...
) -> Generator[list, None, None]: ...
def assertQueryCount(
self, default: int = ..., flush: bool = ..., **counters
) -> Generator[None, None, None]: ...
def assertRecordValues(
self, records: BaseModel, expected_values: list[dict[str, Any]]
) -> None: ...
def assertItemsEqual(self, a, b, msg: str | None = ...) -> None: ...
def assertTreesEqual(self, n1, n2, msg: str | None = ...) -> None: ...
def _assertXMLEqual(self, original: str, expected: str, parser: str = ...) -> None: ...
def _assertXMLEqual(
self, original: str, expected: str, parser: str = ...
) -> None: ...
def assertXMLEqual(self, original: str, expected: str) -> None: ...
def assertHTMLEqual(self, original: str, expected: str) -> None: ...
profile_session: str
@@ -154,23 +172,35 @@ class ChromeBrowser:
def _chrome_start(self) -> None: ...
dev_tools_frontend_url: str
def _find_websocket(self) -> None: ...
def _json_command(self, command: str, timeout: int = ..., get_key: Any | None = ...): ...
def _json_command(
self, command: str, timeout: int = ..., get_key: Any | None = ...
): ...
def _open_websocket(self) -> None: ...
def _receive(self, dbname: str) -> None: ...
def _websocket_request(self, method: str, *, params: Any | None = ..., timeout: float = ...): ...
def _websocket_send(self, method: str, *, params: Any | None = ..., with_future: bool = ...) -> Future | None: ...
def _handle_console(self, type, args: Any | None = ..., stackTrace: Any | None = ..., **kw) -> None: ...
def _websocket_request(
self, method: str, *, params: Any | None = ..., timeout: float = ...
): ...
def _websocket_send(
self, method: str, *, params: Any | None = ..., with_future: bool = ...
) -> Future | None: ...
def _handle_console(
self, type, args: Any | None = ..., stackTrace: Any | None = ..., **kw
) -> None: ...
def _handle_exception(self, exceptionDetails: dict, timestamp) -> None: ...
def _handle_frame_stopped_loading(self, frameId) -> None: ...
def _handle_screencast_frame(self, sessionId, data, metadata) -> None: ...
_TO_LEVEL: dict[str, int]
def take_screenshot(self, prefix: str = ..., suffix: str | None = ...) -> Future: ...
def take_screenshot(
self, prefix: str = ..., suffix: str | None = ...
) -> Future: ...
def _save_screencast(self, prefix: str = ...) -> None: ...
def start_screencast(self) -> None: ...
def set_cookie(self, name: str, value, path, domain) -> None: ...
def delete_cookie(self, name: str, **kwargs) -> None: ...
def _wait_ready(self, ready_code, timeout: int = ...) -> bool: ...
def _wait_code_ok(self, code, timeout: float, error_checker: Any | None = ...) -> None: ...
def _wait_code_ok(
self, code, timeout: float, error_checker: Any | None = ...
) -> None: ...
def navigate_to(self, url: str, wait_stop: bool = ...) -> None: ...
def clear(self) -> None: ...
def _from_remoteobject(self, arg: Mapping): ...
@@ -206,17 +236,37 @@ class HttpCase(TransactionCase):
def start_browser(cls) -> None: ...
@classmethod
def terminate_browser(cls) -> None: ...
def url_open(self, url: str, data: Any | None = ..., files: Mapping | None = ..., timeout: int = ...,
headers: Mapping | None = ..., allow_redirects: bool = ..., head: bool = ...) -> requests.Response: ...
def url_open(
self,
url: str,
data: Any | None = ...,
files: Mapping | None = ...,
timeout: int = ...,
headers: Mapping | None = ...,
allow_redirects: bool = ...,
head: bool = ...,
) -> requests.Response: ...
def _wait_remaining_requests(self, timeout: int = ...) -> None: ...
def logout(self, keep_db: bool = ...) -> None: ...
session: Session
def authenticate(self, user, password) -> Session: ...
def browser_js(self, url_path: str, code: str, ready: str = ..., login: str | None = ..., timeout: int = ...,
cookies: Any | None = ..., error_checker: Any | None = ..., watch: bool = ..., **kw) -> None: ...
def browser_js(
self,
url_path: str,
code: str,
ready: str = ...,
login: str | None = ...,
timeout: int = ...,
cookies: Any | None = ...,
error_checker: Any | None = ...,
watch: bool = ...,
**kw
) -> None: ...
@classmethod
def base_url(cls) -> str: ...
def start_tour(self, url_path: str, tour_name: str, step_delay: float | None = ..., **kwargs) -> None: ...
def start_tour(
self, url_path: str, tour_name: str, step_delay: float | None = ..., **kwargs
) -> None: ...
def profile(self, **kwargs) -> profiler.Nested: ...
def no_retry(arg: _T) -> _T: ...