Skip to content

Commit

Permalink
chore: minor updates to support new GEAG API response structure
Browse files Browse the repository at this point in the history
  • Loading branch information
AfaqShuaib09 committed Oct 25, 2024
1 parent dba582d commit 7f2f211
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def get_variants(self, product):
Returns:
list: A list of variant dicts
"""
variant_keys = ['variant', 'variants', 'future_variants', 'custom_presentations']
variant_keys = ['variant', 'variants', 'futureVariants', 'customPresentations']
variants = []

for key in variant_keys:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ class TestPopulateExecutiveEducationDataCsv(CSVLoaderMixin, TestCase):

SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS = copy.deepcopy(SUCCESS_API_RESPONSE)
SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS['products'][0].update({
'custom_presentations': [{**copy.deepcopy(variant_1), 'websiteVisibility': 'private', 'status': 'active'}],
'future_variants': [
'customPresentations': [{**copy.deepcopy(variant_1), 'websiteVisibility': 'private', 'status': 'active'}],
'futureVariants': [
{
**copy.deepcopy(variant_2), 'websiteVisibility': 'public', 'status': 'scheduled',
'startDate': '2026-03-20', 'endDate': '2026-04-28', 'finalRegCloseDate': '2026-03-26'
**copy.deepcopy(variant_2), 'websiteVisibility': 'public', 'startDate': '2026-03-20',
'endDate': '2026-04-28', 'finalRegCloseDate': '2026-03-26', 'status': 'active'
}
]})

Expand Down Expand Up @@ -264,10 +264,10 @@ def test_populate_executive_education_data_csv_with_new_variants_structure_chang
)

simple_variant = self.SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS["products"][0]["variant"]
future_variant = self.SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS["products"][0]["future_variants"][0]
future_variant = self.SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS["products"][0]["futureVariants"][0]
custom_variant = self.SUCCESS_API_RESPONSE_CUSTOM_AND_FUTURE_VARIANTS[
"products"
][0]["custom_presentations"][0]
][0]["customPresentations"][0]

with open(output_csv.name, "r") as csv_file:
reader = csv.DictReader(csv_file)
Expand Down

0 comments on commit 7f2f211

Please sign in to comment.