mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 07:21:13 -05:00
Standardized command names and updated
documentation
This commit is contained in:
@@ -856,9 +856,9 @@ fake = Faker(["en_US"])
|
||||
|
||||
|
||||
# generate n number of test orgs into the dev DB
|
||||
@notify_command(name="add-test-organization-to-db")
|
||||
@notify_command(name="add-test-organizations-to-db")
|
||||
@click.option("-g", "--generate", required=True, prompt=True, default=1)
|
||||
def add_test_organization_to_db(generate):
|
||||
def add_test_organizations_to_db(generate):
|
||||
def generate_gov_agency():
|
||||
agency_names = [
|
||||
"Bureau",
|
||||
@@ -914,9 +914,9 @@ def add_test_organization_to_db(generate):
|
||||
|
||||
|
||||
# generate n number of test services into the dev DB
|
||||
@notify_command(name="add-test-service-to-db")
|
||||
@notify_command(name="add-test-services-to-db")
|
||||
@click.option("-g", "--generate", required=True, prompt=True, default=1)
|
||||
def add_test_service_to_db(generate):
|
||||
def add_test_services_to_db(generate):
|
||||
if getenv("NOTIFY_ENVIRONMENT", "") not in ["development", "test"]:
|
||||
current_app.logger.error("Can only be run in development")
|
||||
return
|
||||
@@ -928,9 +928,9 @@ def add_test_service_to_db(generate):
|
||||
|
||||
|
||||
# generate n number of test jobs into the dev DB
|
||||
@notify_command(name="add-test-job-to-db")
|
||||
@notify_command(name="add-test-jobs-to-db")
|
||||
@click.option("-g", "--generate", required=True, prompt=True, default=1)
|
||||
def add_test_job_to_db(generate):
|
||||
def add_test_jobs_to_db(generate):
|
||||
if getenv("NOTIFY_ENVIRONMENT", "") not in ["development", "test"]:
|
||||
current_app.logger.error("Can only be run in development")
|
||||
return
|
||||
@@ -943,9 +943,9 @@ def add_test_job_to_db(generate):
|
||||
|
||||
|
||||
# generate n number of notifications into the dev DB
|
||||
@notify_command(name="add-test-notification-to-db")
|
||||
@notify_command(name="add-test-notifications-to-db")
|
||||
@click.option("-g", "--generate", required=True, prompt=True, default=1)
|
||||
def add_test_notification_to_db(generate):
|
||||
def add_test_notifications_to_db(generate):
|
||||
if getenv("NOTIFY_ENVIRONMENT", "") not in ["development", "test"]:
|
||||
current_app.logger.error("Can only be run in development")
|
||||
return
|
||||
@@ -962,11 +962,11 @@ def add_test_notification_to_db(generate):
|
||||
|
||||
|
||||
# generate n number of test users into the dev DB
|
||||
@notify_command(name="add-test-users")
|
||||
@notify_command(name="add-test-users-to-db")
|
||||
@click.option("-g", "--generate", required=True, prompt=True, default="1")
|
||||
@click.option("-s", "--state", default="active")
|
||||
@click.option("-d", "--admin", default=False, type=bool)
|
||||
def add_test_users(generate, state, admin):
|
||||
def add_test_users_to_db(generate, state, admin):
|
||||
if getenv("NOTIFY_ENVIRONMENT", "") not in ["development", "test"]:
|
||||
current_app.logger.error("Can only be run in development")
|
||||
return
|
||||
|
||||
12
docs/all.md
12
docs/all.md
@@ -495,6 +495,18 @@ cf run-task CLOUD-GOV-APP --command "flask command update-templates" --name YOUR
|
||||
|
||||
[Here's more documentation](https://docs.cloudfoundry.org/devguide/using-tasks.html) about Cloud Foundry tasks.
|
||||
|
||||
# Commands for test loading the local dev database
|
||||
|
||||
All commands use the `-g` or `--generate` to determine how many instances to load to the db. The `-g` or `--generate` option is required and will always defult to 1. An example: `flask command add-test-uses-to-db -g 6` will generate 6 random users and insert them into the db.
|
||||
|
||||
## Test commands list
|
||||
- `add-test-organizations-to-db`
|
||||
- `add-test-services-to-db`
|
||||
- `add-test-jobs-to-db`
|
||||
- `add-test-notifications-to-db`
|
||||
- `add-test-users-to-db` (extra options include `-s` or `--state` and `-d` or `--admin`)
|
||||
|
||||
|
||||
# How messages are queued and sent
|
||||
|
||||
There are several ways for notifications to come into the API.
|
||||
|
||||
Reference in New Issue
Block a user