Skip to content

Commit

Permalink
chore: added statements to check for empty csv records
Browse files Browse the repository at this point in the history
  • Loading branch information
AfaqShuaib09 committed Oct 16, 2024
1 parent 825cfa0 commit 66f53e3
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ def test_skip_products_ingestion_if_variants_data_empty(self, mock_get_smarter_c
),
)

output_csv.seek(0)
with open(output_csv.name, 'r') as csv_file:
reader = csv.DictReader(csv_file)
# check for empty csv file
assert not any(reader)

@mock.patch('course_discovery.apps.course_metadata.utils.GetSmarterEnterpriseApiClient')
def test_successful_file_data_population_with_getsmarter_flag_with_multiple_variants(self, mock_get_smarter_client):
"""
Expand Down

0 comments on commit 66f53e3

Please sign in to comment.