Update stubs

This commit is contained in:
Trinh Anh Ngoc
2022-10-16 17:54:41 +07:00
parent 54b80dae72
commit aca45587c8

View File

@@ -1,10 +1,12 @@
import collections
import logging
import sys
import unittest
from re import Pattern
from itertools import count
from typing import Any, Callable, Generator, Generic, Iterator, Literal, Mapping, Match, TypeVar
from unittest import TestSuite
from xmlrpc import client as xmlrpclib
import requests
@@ -12,7 +14,7 @@ from lxml.etree import _Element
from websocket import WebSocket
from ..api import Environment
from ..http import OpenERPSession
from ..http import Session
from ..models import BaseModel
from ..modules.registry import Registry
from ..sql_db import BaseCursor, Cursor
@@ -25,9 +27,13 @@ _CallableT = TypeVar('_CallableT', bound=Callable)
_ModelT = TypeVar('_ModelT', bound=BaseModel)
_FormT = TypeVar('_FormT', bound=Form)
InvalidStateError = Any
ADDONS_PATH: str
HOST: str
ADMIN_USER_ID: int
CHECK_BROWSER_SLEEP: float
CHECK_BROWSER_ITERATIONS: int
BROWSER_WAIT: float
def get_db_name() -> str: ...
@@ -50,11 +56,10 @@ class RecordCapturer:
@property
def records(self) -> BaseModel: ...
class OdooSuite(unittest.suite.TestSuite):
def __init__(self, *args, **kwargs) -> None: ...
BackportSuite: type[TestSuite]
class OdooSuite(BackportSuite):
def _handleClassSetUp(self, test, result) -> None: ...
def _createClassOrModuleLevelException(self, result, exc, method_name, parent, info: Any | None = ...) -> None: ...
def _addClassOrModuleLevelException(self, result, exception, errorName, info: Any | None = ...) -> None: ...
def _tearDownPreviousClass(self, test, result) -> None: ...
class MetaCase(type):
@@ -75,6 +80,7 @@ class BaseCase(unittest.TestCase, metaclass=MetaCase):
longMessage: bool
warm: bool
def __init__(self, methodName: str = ...) -> None: ...
def run(self, result) -> None: ...
def shortDescription(self) -> None: ...
def cursor(self) -> Cursor: ...
@property
@@ -84,9 +90,17 @@ class BaseCase(unittest.TestCase, metaclass=MetaCase):
def ref(self, xid: str) -> int: ...
def browse_ref(self, xid: str) -> BaseModel | None: ...
def patch(self, obj, key, val) -> None: ...
@classmethod
def classPatch(cls, obj, key, val) -> None: ...
def startPatcher(self, patcher): ...
@classmethod
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: ...
if sys.version_info < (3, 10):
def assertNoLogs(self, logger: str, level: str): ...
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: ...
@@ -105,6 +119,8 @@ class TransactionCase(BaseCase):
env: Environment
cr: Cursor
@classmethod
def _gc_filestore(cls) -> None: ...
@classmethod
def setUpClass(cls) -> None: ...
_savepoint_id: int
def setUp(self): ...
@@ -122,6 +138,9 @@ class SingleTransactionCase(BaseCase):
class ChromeBrowserException(Exception): ...
def fmap(future, map_fun): ...
def fchain(future, next_callback): ...
class ChromeBrowser:
test_class: str
devtools_port: int | None