Skip to content

Commit

Permalink
Fix more linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdelrio committed Sep 26, 2023
1 parent 012b159 commit 6d224a7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 45 deletions.
6 changes: 2 additions & 4 deletions parsons/mobilecommons/mobilecommons.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
from requests import HTTPError
import xmltodict
import logging
import math

logger = logging.getLogger(__name__)

MC_URI = "https://secure.mcommons.com/api/"
DATE_FMT = "%Y-%m-%d"
format_date = lambda x: parse_date(x).strftime(DATE_FMT) if x is not None else None


class MobileCommons:
"""
Instantiate the MobileCommons class.
Expand Down Expand Up @@ -343,8 +341,8 @@ def get_profiles(
Parsons table with requested broadcasts
"""

custom_cols = "true" if include_custom_columns == True else "false"
subscriptions = "true" if include_subscriptions == True else "false"
custom_cols = "true" if include_custom_columns else "false"
subscriptions = "true" if include_subscriptions else "false"

params = {
"phone_number": phones,
Expand Down
82 changes: 41 additions & 41 deletions test/test_mobilecommons/mobilecommons_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,35 @@ class get_profiles_response:
<custom_column name="Birthday"/>
<custom_column name="Caregiver"/>
<custom_column name="Contact Frequency"/>
<custom_column
name="f_name"
created_at="2022-07-01T15:19:18Z"
<custom_column
name="f_name"
created_at="2022-07-01T15:19:18Z"
updated_at="2022-07-01T15:19:18Z">
Cormac
Cormac
</custom_column>
<custom_column name="Interest"/>
<custom_column
name="l_name"
created_at="2022-07-01T15:19:30Z"
<custom_column
name="l_name"
created_at="2022-07-01T15:19:30Z"
updated_at="2022-07-01T15:19:30Z">
Martinez del Rio
Martinez del Rio
</custom_column>
<custom_column name="MoneyConcerns"/>
<custom_column name="PantryType"/>
<custom_column name="Parent"/>
<custom_column name="PersonalFlex"/>
</custom_columns>
<subscriptions>
<subscription
campaign_id="22345"
campaign_name="Test Campaign "
campaign_description="This is just a test babe"
opt_in_path_id="22233"
status="Opted-Out"
opt_in_source="JOIN"
created_at="2022-06-29T17:28:24Z"
activated_at="2022-06-29T17:28:24Z"
opted_out_at="2022-07-01T15:18:59Z"
<subscription
campaign_id="22345"
campaign_name="Test Campaign"
campaign_description="This is just a test babe"
opt_in_path_id="22233"
status="Opted-Out"
opt_in_source="JOIN"
created_at="2022-06-29T17:28:24Z"
activated_at="2022-06-29T17:28:24Z"
opted_out_at="2022-07-01T15:18:59Z"
opt_out_source="Texted a STOP word"/>
</subscriptions>
<integrations>
Expand Down Expand Up @@ -112,7 +112,7 @@ class get_broadcasts_response:
</broadcast>
<broadcast id="2541464" status="generated">
<name>Test 6/6 DD DH </name>
<body>Hey {{first_name}}!! On a scale of 1-5, how is your day going?
<body>Hey {{first_name}}!! On a scale of 1-5, how is your day going?
Reply STOP to quit. Msg&amp;DataRatesMayApply</body>
<campaign id="233056" active="true">
<name>TEST DH DD</name>
Expand All @@ -135,7 +135,7 @@ class get_broadcasts_response:
</broadcast>
<broadcast id="2536296" status="draft">
<name>Broadcast 04/10/2023 01:34PM test</name>
<body>hi name, what's your email? Recurring Msgs. Reply STOP to quit, HELP for info.
<body>hi name, what's your email? Recurring Msgs. Reply STOP to quit, HELP for info.
Msg&amp;DataRatesMayApply</body>
<campaign id="228634" active="true">
<name>Dog King 2024</name>
Expand Down Expand Up @@ -176,10 +176,10 @@ class post_profile_response:
<updated_at>2023-03-14 21:46:58 UTC</updated_at>
<opted_out_at>2022-09-16 01:07:50 UTC</opted_out_at>
<opted_out_source>Opt-out from API</opted_out_source>
<source
type="Keyword"
name="JOIN" id="8657035"
opt_in_path_id="328887"
<source
type="Keyword"
name="JOIN" id="8657035"
opt_in_path_id="328887"
message_id="1776761263"
/>
<address>
Expand Down Expand Up @@ -210,34 +210,34 @@ class post_profile_response:
<custom_column name="Birthday"/>
<custom_column name="Caregiver"/>
<custom_column name="Contact Frequency"/>
<custom_column name="f_name"
created_at="2022-07-01T15:19:18Z"
<custom_column name="f_name"
created_at="2022-07-01T15:19:18Z"
updated_at="2022-07-01T15:19:18Z">
Cormac
Cormac
</custom_column>
<custom_column name="Interest"/>
<custom_column
name="l_name"
created_at="2022-07-01T15:19:30Z"
<custom_column
name="l_name"
created_at="2022-07-01T15:19:30Z"
updated_at="2022-07-01T15:19:30Z">
Martinez del Rio
Martinez del Rio
</custom_column>
<custom_column name="MoneyConcerns"/>
<custom_column name="PantryType"/>
<custom_column name="Parent"/>
<custom_column name="PersonalFlex"/>
</custom_columns>
<subscriptions>
<subscription
campaign_id="227047"
campaign_name="Primary Campaign "
campaign_description="Campaigntest"
opt_in_path_id="328887"
status="Opted-Out"
opt_in_source="JOIN"
created_at="2022-06-29T17:28:24Z"
activated_at="2022-06-29T17:28:24Z"
opted_out_at="2022-07-01T15:18:59Z"
<subscription
campaign_id="227047"
campaign_name="Primary Campaign "
campaign_description="Campaigntest"
opt_in_path_id="328887"
status="Opted-Out"
opt_in_source="JOIN"
created_at="2022-06-29T17:28:24Z"
activated_at="2022-06-29T17:28:24Z"
opted_out_at="2022-07-01T15:18:59Z"
opt_out_source="Texted a STOP word"
/>
</subscriptions>
Expand Down

0 comments on commit 6d224a7

Please sign in to comment.