Skip to content

Commit

Permalink
unit
Browse files Browse the repository at this point in the history
  • Loading branch information
lcouzens committed Dec 2, 2024
1 parent e339b37 commit dd32450
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions koku/masu/test/external/downloader/test_report_downloader_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,25 +136,21 @@ def test_process_manifest_db_record_file_num_changed(self):
self.assertEqual(result_manifest.num_total_files, expected_count)

def test_process_manifest_db_record_large_provider(self):
"""Test that the _process_manifest_db_record updates the provider as large when over 75 reports re found."""
with self.assertLogs("masu.external.downloader.report_downloader_base", level="INFO") as logger:
CostUsageReportStatus.objects.create(
report_name="fake_report.csv",
completed_datetime=self.billing_start,
started_datetime=self.billing_start,
etag="etag",
manifest=self.manifest,
)
manifest_id = self.downloader._process_manifest_db_record(
self.assembly_id, self.billing_start, 100, self.today
)
"""Test that the _process_manifest_db_record updates the provider as large when over 75 reports are found."""
CostUsageReportStatus.objects.create(
report_name="fake_report.csv",
completed_datetime=self.billing_start,
started_datetime=self.billing_start,
etag="etag",
manifest=self.manifest,
)
manifest_id = self.downloader._process_manifest_db_record(
self.assembly_id, self.billing_start, 100, self.today
)
self.assertEqual(manifest_id, self.manifest.id)
with ReportManifestDBAccessor() as manifest_accessor:
result_manifest = manifest_accessor.get_manifest_by_id(manifest_id)
expected_count = CostUsageReportStatus.objects.filter(manifest_id=self.manifest_id).count()
self.assertEqual(result_manifest.num_total_files, expected_count)
query_result = Provider.objects.filter(uuid=self.aws_provider_uuid).first()
self.assertEqual(query_result.large, True)
assert any(
"Provider set as large for XL processing." in log for log in logger.output
), "Provider set to large not found in logs"

0 comments on commit dd32450

Please sign in to comment.