Skip to content

Commit 29d2798

Browse files
committed
Fix generator unit tests #10
These were broken when I merged in a branch earlier.
1 parent d2be9c8 commit 29d2798

2 files changed

Lines changed: 21 additions & 15 deletions

File tree

generator/generate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ def py_annotation(self):
529529
def generate_doc(self):
530530
''' Generate the docstring for this return. '''
531531
if self.description:
532-
doc = self.description.replace('`', '``').replace('\n', ' ')
532+
doc = self.description.replace('\n', ' ')
533533
if self.optional:
534534
doc = f'*(Optional)* {doc}'
535535
else:
@@ -622,7 +622,7 @@ def generate_code(self) -> str:
622622
elif len(self.returns) > 1:
623623
doc += '\n'
624624
doc += ':returns: A tuple with the following items:\n\n'
625-
ret_docs = '\n'.join(f'{i+1}. **{r.name}** - {r.generate_doc()}' for i, r
625+
ret_docs = '\n'.join(f'{i}. **{r.name}** {r.generate_doc()}' for i, r
626626
in enumerate(self.returns))
627627
doc += indent(ret_docs, 4)
628628
if doc:

generator/test_generate.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,13 @@ def get_partial_ax_tree(
272272
'''
273273
Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.
274274
275-
:param node_id: Identifier of the node to get the partial accessibility tree for.
276-
:param backend_node_id: Identifier of the backend node to get the partial accessibility tree for.
277-
:param object_id: JavaScript object id of the node wrapper to get the partial accessibility tree for.
278-
:param fetch_relatives: Whether to fetch this nodes ancestors, siblings and children. Defaults to true.
279-
:returns: The ``Accessibility.AXNode`` for this DOM node, if it exists, plus its ancestors, siblings and
280-
children, if requested.
275+
**EXPERIMENTAL**
276+
277+
:param node_id: *(Optional)* Identifier of the node to get the partial accessibility tree for.
278+
:param backend_node_id: *(Optional)* Identifier of the backend node to get the partial accessibility tree for.
279+
:param object_id: *(Optional)* JavaScript object id of the node wrapper to get the partial accessibility tree for.
280+
:param fetch_relatives: *(Optional)* Whether to fetch this nodes ancestors, siblings and children. Defaults to true.
281+
:returns: The ``Accessibility.AXNode`` for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.
281282
'''
282283
params: T_JSON_DICT = dict()
283284
if node_id is not None:
@@ -385,6 +386,8 @@ def get_browser_command_line() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typin
385386
Returns the command line switches for the browser process if, and only if
386387
--enable-automation is on the commandline.
387388
389+
**EXPERIMENTAL**
390+
388391
:returns: Commandline parameters
389392
'''
390393
cmd_dict: T_JSON_DICT = {
@@ -543,12 +546,13 @@ def get_encoded_response(
543546
544547
:param request_id: Identifier of the network request to get content for.
545548
:param encoding: The encoding to use.
546-
:param quality: The quality of the encoding (0-1). (defaults to 1)
547-
:param size_only: Whether to only return the size information (defaults to false).
548-
:returns: a tuple with the following items:
549-
0. body: (Optional) The encoded body as a base64 string. Omitted if sizeOnly is true.
550-
1. originalSize: Size before re-encoding.
551-
2. encodedSize: Size after re-encoding.
549+
:param quality: *(Optional)* The quality of the encoding (0-1). (defaults to 1)
550+
:param size_only: *(Optional)* Whether to only return the size information (defaults to false).
551+
:returns: A tuple with the following items:
552+
553+
0. **body** – *(Optional)* The encoded body as a base64 string. Omitted if sizeOnly is true.
554+
1. **originalSize** – Size before re-encoding.
555+
2. **encodedSize** – Size after re-encoding.
552556
'''
553557
params: T_JSON_DICT = dict()
554558
params['requestId'] = request_id.to_json()
@@ -607,9 +611,11 @@ def grant_permissions(
607611
'''
608612
Grant specific permissions to the given origin and reject all others.
609613
614+
**EXPERIMENTAL**
615+
610616
:param origin:
611617
:param permissions:
612-
:param browser_context_id: BrowserContext to override permissions. When omitted, default browser context is used.
618+
:param browser_context_id: *(Optional)* BrowserContext to override permissions. When omitted, default browser context is used.
613619
'''
614620
params: T_JSON_DICT = dict()
615621
params['origin'] = origin

0 commit comments

Comments
 (0)