more tests

This commit is contained in:
Kenneth Kehl
2023-08-14 15:32:22 -07:00
parent b4a2f37ca9
commit b9ba7d018b
10 changed files with 109 additions and 0 deletions

View File

@@ -336,6 +336,7 @@ def create_random_identifier():
return ''.join(secrets.choice(string.ascii_uppercase + string.digits) for _ in range(16))
# TODO maintainability what is the purpose of this? Debugging?
def setup_sqlalchemy_events(app):
TOTAL_DB_CONNECTIONS = Gauge(

View File

@@ -147,6 +147,8 @@ def purge_functional_test_data(user_email_prefix):
@click.option('-f', '--file_name', required=True,
help="""Full path of the file to upload, file is a contains inbound numbers, one number per line.""")
def insert_inbound_numbers_from_file(file_name):
# TODO maintainability what is the purpose of this command? Who would use it and why?
print("Inserting inbound numbers from {}".format(file_name))
with open(file_name) as file:
sql = "insert into inbound_numbers values('{}', '{}', 'sns', null, True, now(), null);"
@@ -168,6 +170,9 @@ def setup_commands(application):
@click.option('-d', '--day', help="The date to recalculate, as YYYY-MM-DD", required=True,
type=click_dt(format='%Y-%m-%d'))
def rebuild_ft_billing_for_day(service_id, day):
# TODO maintainability what is the purpose of this command? Who would use it and why?
"""
Rebuild the data in ft_billing for the given service_id and date
"""
@@ -386,6 +391,8 @@ def populate_service_volume_intentions(file_name):
# [1] SMS:: volume intentions for service
# [2] Email:: volume intentions for service
# TODO maintainability what is the purpose of this command? Who would use it and why?
with open(file_name, 'r') as f:
for line in itertools.islice(f, 1, None):
columns = line.split(',')

View File

@@ -45,6 +45,7 @@ class InvalidRequest(Exception):
return str(self.to_dict())
# TODO maintainability what is this for? How to unit test it?
def register_errors(blueprint):
@blueprint.errorhandler(InvalidEmailError)
def invalid_format(error):