How to use the mangum.platforms.aws.helpers.get_default_resource_name function in mangum

To help you get started, we’ve selected a few mangum examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github erm / mangum / tests / test_aws_config.py View on Github external
def test_get_default_resource_name() -> None:
    resource_name = get_default_resource_name("helloworldproject")
    assert resource_name == "Helloworldproject"
    resource_name_with_underscores = get_default_resource_name("hello_world_project")
    assert resource_name_with_underscores == "HelloWorldProject"
github erm / mangum / tests / test_aws_config.py View on Github external
def test_get_default_resource_name() -> None:
    resource_name = get_default_resource_name("helloworldproject")
    assert resource_name == "Helloworldproject"
    resource_name_with_underscores = get_default_resource_name("hello_world_project")
    assert resource_name_with_underscores == "HelloWorldProject"
github erm / mangum / mangum / platforms / aws / commands.py View on Github external
config_dir = os.getcwd()
    project_dir = os.path.join(config_dir, project_dir_name)
    if not os.path.isdir(project_dir):
        raise click.ClickException(
            f"Directory not found at {project_dir}! "
            "(Hint: The project folder must be in current working directory.)"
        )
    description = click.prompt(
        "Enter a brief description of your project.",
        type=str,
        default="ASGI application",
    )
    resource_name = click.prompt(
        "What should be the prefix used for naming resources?",
        type=str,
        default=get_default_resource_name(project_name),
    )
    url_root = click.prompt("What should be the root URL path?", type=str, default="/")
    runtime_version = click.prompt(
        "What version of Python are you using?", type=str, default="3.7"
    )
    timeout = click.prompt(
        "What should the timeout be (in seconds, max=300)?", type=int, default=300
    )
    default_region_name = get_default_region_name()
    region_name = click.prompt(
        "What region should be used?", default=default_region_name
    )
    s3_bucket_name = click.prompt(
        "An S3 bucket is required. \n\nEnter the name of an existing bucket or "
        f"one will be generated.",
        type=str,