remove print statements

This commit is contained in:
Kenneth Kehl
2024-01-05 10:39:07 -08:00
parent 88379c9e46
commit a5f78224b2
3 changed files with 0 additions and 15 deletions

View File

@@ -66,9 +66,7 @@ def get_job_and_metadata_from_s3(service_id, job_id):
def get_job_from_s3(service_id, job_id): def get_job_from_s3(service_id, job_id):
print(f"ENTERE get_job_from_s3 with {service_id} {job_id}")
obj = get_s3_object(*get_job_location(service_id, job_id)) obj = get_s3_object(*get_job_location(service_id, job_id))
print(f"obj is {obj}")
return obj.get()["Body"].read().decode("utf-8") return obj.get()["Body"].read().decode("utf-8")
@@ -76,21 +74,11 @@ def get_phone_number_from_s3(service_id, job_id, job_row_number):
# We don't want to constantly pull down a job from s3 every time we need a phone number. # We don't want to constantly pull down a job from s3 every time we need a phone number.
# At the same time we don't want to store it in redis or the db # At the same time we don't want to store it in redis or the db
# So this is a little recycling mechanism to reduce the number of downloads. # So this is a little recycling mechanism to reduce the number of downloads.
print(
f"ENTER GET_PHONE_NUMBER_FROM_S3 WITH JOB_ID {job_id} SERVICE_ID {service_id} JOB_ROW_NUMBER {job_row_number}"
)
job = JOBS.get(job_id) job = JOBS.get(job_id)
print(f"JOB FROM EXPIRINGDICT {job} JOB ID {job_id}")
if job is None: if job is None:
print("JOB IS NONE")
job = get_job_from_s3(service_id, job_id) job = get_job_from_s3(service_id, job_id)
print(f"FRESH JOB {job}")
JOBS[job_id] = job JOBS[job_id] = job
print("ADDED {job} to EXPRING DICT")
else:
print("JOB IS NOT NONE")
job = job.split("\r\n") job = job.split("\r\n")
print(f"JOB AFTER SPLIT {job}")
first_row = job[0] first_row = job[0]
job.pop(0) job.pop(0)
first_row = first_row.split(",") first_row = first_row.split(",")

View File

@@ -76,12 +76,10 @@ def send_sms_to_provider(notification):
notification.job_id, notification.job_id,
notification.job_row_number, notification.job_row_number,
) )
print(f"MY PHONE FROM JOB {my_phone}")
except BaseException: except BaseException:
my_phone = redis_store.get(f"2facode_{notification.id}") my_phone = redis_store.get(f"2facode_{notification.id}")
if my_phone: if my_phone:
my_phone = my_phone.decode("utf-8") my_phone = my_phone.decode("utf-8")
print(f"MY PHONE FROM VERIFY CODE {my_phone}")
if my_phone is None: if my_phone is None:
raise Exception("what happened to the phone number") raise Exception("what happened to the phone number")
send_sms_kwargs = { send_sms_kwargs = {

View File

@@ -62,7 +62,6 @@ def test_get_phone_number_from_s3(
): ):
get_job_mock = mocker.patch("app.aws.s3.get_job_from_s3") get_job_mock = mocker.patch("app.aws.s3.get_job_from_s3")
get_job_mock.return_value = job get_job_mock.return_value = job
print(f"ABOUT TO CALL GET_PHONE_NUMBER_FROM_S3 WITH JOB_ID {job_id}")
phone_number = get_phone_number_from_s3("service_id", job_id, job_row_number) phone_number = get_phone_number_from_s3("service_id", job_id, job_row_number)
assert phone_number == expected_phone_number assert phone_number == expected_phone_number