Help Topics for tests

Project

clock

Function

to_download

Sample CLI

gway clock to-download

Signature

(filesize)

Docstring

Prompt: Create a python function that takes a file size such as 100 MB or 1.76 GB (pick a wide array of units) and then calculates the possible time to download it within 4 ranges. You choose the ranges logarithmically. Then, perform a quick check against google to let the user know what their current range is.

Project

release

Function

build

Sample CLI

gway release build

References

['abort', 'error', 'info', 'readme', 'readme.collect_projects', 'resource', 'test']

Signature

(*, bump: bool = False, dist: bool = False, twine: bool = False, help_db: bool = True, user: str =
'[PYPI_USERNAME]', password: str = '[PYPI_PASSWORD]', token: str = '[PYPI_API_TOKEN]', projects:
bool = False, git: bool = False, all: bool = False) -> None

Docstring

Build the project and optionally upload to PyPI. Args: bump (bool): Increment patch version if True. dist (bool): Build distribution package if True. twine (bool): Upload to PyPI if True. user (str): PyPI username (default: [PYPI_USERNAME]). password (str): PyPI password (default: [PYPI_PASSWORD]). token (str): PyPI API token (default: [PYPI_API_TOKEN]). git (bool): Require a clean git repo and commit/push after release if True. vscode (bool): Build the vscode extension.

Project

release

Function

loc

Sample CLI

gway release loc

References

['resource']

Signature

(*paths)

Docstring

Counts Python lines of code in the given directories, ignoring hidden files and directories. Defaults to everything in the current GWAY release.

Project

tests

Function

dummy_function

Sample CLI

gway tests dummy-function

Signature

(param1: str, param2: str = 'default')

Docstring

Dummy function for testing.

Project

tests

Function

variadic_both

Sample CLI

gway tests variadic-both

Signature

(*args, **kwargs)

Project

tests

Function

variadic_keyword

Sample CLI

gway tests variadic-keyword

Signature

(**kwargs)

Project

tests

Function

variadic_positional

Sample CLI

gway tests variadic-positional

Signature

(*args)

Project

tests

Function

view_index

Sample CLI

gway tests view-index

Signature

()

Project

web.app

Function

render_template

Sample CLI

gway web.app render-template

References

['version']

Signature

(*, title='GWAY', navbar='', content='', static='static', css_files=None)

Project

web.app

Function

urlencode

Sample CLI

gway web.app urlencode

Signature

(query, doseq=False, safe='', encoding=None, errors=None, quote_via=)

Docstring

Encode a dict or sequence of two-element tuples into a URL query string. If any values in the query arg are sequences and doseq is true, each sequence element is converted to a separate parameter. If the query arg is a sequence of two-element tuples, the order of the parameters in the output will match the order of parameters in the input. The components of a query arg may each be either a string or a bytes type. The safe, encoding, and errors parameters are passed down to the function specified by quote_via (encoding and errors only if a component is a str).

Project

web.proxy

Function

setup_app

Sample CLI

gway web.proxy setup-app

References

['unwrap']

Signature

(*, endpoint: str, app=None, websockets: bool = False, path: str = '/')

Docstring

Create an HTTP (and optional WebSocket) proxy to the given endpoint. Accepts positional apps, the `app=` kwarg, or both. Flattens any iterables and selects apps by type using gw.filter_apps. Returns a single app if one is provided, otherwise a tuple of apps.

TODOs

# TODO: Test if this is properly compatible with web.server.start_app

Project

builtin

Function

hello_world

Sample CLI

gway hello-world

Signature

(name: str = 'World', *, greeting: str = 'Hello')

Docstring

Smoke test function.

Project

builtin

Function

test

Sample CLI

gway test

References

['info']

Signature

(root: str = 'tests', filter=None)

Docstring

Execute all automatically detected test suites.