Update stubs

This commit is contained in:
Trinh Anh Ngoc
2023-05-29 18:11:37 +07:00
parent f4a7120fee
commit 7166cee540
4 changed files with 13 additions and 18 deletions

View File

@@ -4,3 +4,4 @@ from ..sql_db import Cursor
def get_installed_modules(cursor: Cursor) -> list[str]: ...
def get_neutralization_queries(modules: Iterable[str]) -> Iterator[str]: ...
def neutralize_database(cursor: Cursor) -> None: ...

View File

@@ -18,13 +18,17 @@ def exp_create_database(
country_code: str | None = ...,
phone: str | None = ...,
) -> Literal[True]: ...
def exp_duplicate_database(db_original_name: str, db_name: str) -> Literal[True]: ...
def exp_duplicate_database(
db_original_name: str, db_name: str, neutralize_database: bool = ...
) -> Literal[True]: ...
def exp_drop(db_name: str) -> bool: ...
def exp_dump(db_name: str, format: str) -> str: ...
def dump_db_manifest(cr: Cursor) -> dict[str, Any]: ...
def dump_db(db_name: str, stream, backup_format: str = ...) -> IO | None: ...
def exp_restore(db_name: str, data, copy: bool = ...) -> Literal[True]: ...
def restore_db(db: str, dump_file: str, copy: bool = ...) -> None: ...
def restore_db(
db: str, dump_file: str, copy: bool = ..., neutralize_database: bool = ...
) -> None: ...
def exp_rename(old_name: str, new_name: str) -> Literal[True]: ...
def exp_change_admin_password(new_password: str) -> Literal[True]: ...
def exp_migrate_databases(databases: Iterable[str]) -> Literal[True]: ...

View File

@@ -1,6 +1,7 @@
import collections
from concurrent.futures import Future
from itertools import count
from subprocess import Popen
from typing import Any, Callable, Generator, Mapping, Match, TypeVar
from xmlrpc import client as xmlrpclib
@@ -123,27 +124,23 @@ def fchain(future, next_callback): ...
class ChromeBrowser:
remote_debugging_port: int
test_class: type[HttpCase]
chrome: Popen
devtools_port: int | None
ws_url: str
ws: WebSocket | None
request_id: int
user_data_dir: str
chrome_pid: int | None
screenshots_dir: str
screencasts_dir: str | None
screencasts_frames_dir: str | None
screencast_frames: list
window_size: str
touch_enabled: bool
sigxcpu_handler: Any
error_checker: Any
had_failure: bool
def __init__(self, test_class: type[HttpCase]) -> None: ...
def __init__(self, test_class: type[HttpCase], headless: bool = ...) -> None: ...
@property
def screencasts_frames_dir(self) -> str: ...
def signal_handler(self, sig, frame) -> None: ...
def stop(self) -> None: ...
@property
def executable(self) -> str | None: ...
dev_tools_frontend_url: str
def take_screenshot(
self, prefix: str = ..., suffix: str | None = ...
) -> Future: ...
@@ -151,7 +148,6 @@ class ChromeBrowser:
def set_cookie(self, name: str, value, path, domain) -> None: ...
def delete_cookie(self, name: str, **kwargs) -> None: ...
def navigate_to(self, url: str, wait_stop: bool = ...) -> None: ...
def clear(self) -> None: ...
LINE_PATTERN: str
def console_formatter(self, args: list) -> Callable[[Match[str]], str]: ...
@@ -178,10 +174,6 @@ class HttpCase(TransactionCase):
xmlrpc_object: xmlrpclib.ServerProxy
opener: Opener
def setUp(self) -> None: ...
@classmethod
def start_browser(cls) -> None: ...
@classmethod
def terminate_browser(cls) -> None: ...
def url_open(
self,
url: str,
@@ -194,7 +186,7 @@ class HttpCase(TransactionCase):
) -> requests.Response: ...
def logout(self, keep_db: bool = ...) -> None: ...
session: Session
def authenticate(self, user, password) -> Session: ...
def authenticate(self, user, password, browser: ChromeBrowser = ...) -> Session: ...
def browser_js(
self,
url_path: str,

View File

@@ -23,5 +23,3 @@ from .sql import *
from .template_inheritance import *
from .translate import *
from .xml_utils import *
SUPPORTED_DEBUGGER: set[str]