Skip to content

Commit 8a1dd67

Browse files
committed
Update tests to remove checks for files processed in folio_data_import based loader tasks
1 parent 2d52b09 commit 8a1dd67

File tree

3 files changed

+0
-50
lines changed

3 files changed

+0
-50
lines changed

tests/test_inventory_batch_poster.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -444,41 +444,6 @@ def test_wrap_up_writes_reports(self, tmp_path):
444444
assert poster.clean_out_empty_logs.called
445445

446446

447-
class TestInventoryBatchPosterFilesProcessed:
448-
"""Tests for file processing tracking."""
449-
450-
def test_files_added_to_report(self):
451-
"""Test that processed files are added to migration report."""
452-
from folio_data_import.BatchPoster import BatchPosterStats
453-
454-
poster = Mock(spec=InventoryBatchPoster)
455-
poster.task_configuration = InventoryBatchPoster.TaskConfiguration(
456-
name="test",
457-
migration_task_type="InventoryBatchPoster",
458-
object_type="Holdings",
459-
files=[
460-
FileDefinition(file_name="holdings1.json"),
461-
FileDefinition(file_name="holdings2.json"),
462-
FileDefinition(file_name="holdings3.json"),
463-
],
464-
rerun_failed_records=False,
465-
)
466-
poster.stats = BatchPosterStats()
467-
poster.migration_report = Mock()
468-
poster._translate_stats_to_migration_report = MethodType(
469-
InventoryBatchPoster._translate_stats_to_migration_report, poster
470-
)
471-
472-
poster._translate_stats_to_migration_report()
473-
474-
# Verify all files were added
475-
add_calls = poster.migration_report.add.call_args_list
476-
added_files = [call[0][1] for call in add_calls if call[0][0] == "FilesProcessed"]
477-
assert "holdings1.json" in added_files
478-
assert "holdings2.json" in added_files
479-
assert "holdings3.json" in added_files
480-
481-
482447
class TestInventoryBatchPosterNoProgress:
483448
"""Tests for progress reporting configuration."""
484449

tests/test_marc_import.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ def test_translate_stats_to_migration_report(self):
332332
import_profile_name="Test Profile",
333333
)
334334
importer.total_records_sent = 10000
335-
importer.files_processed = ["bibs1.mrc", "bibs2.mrc"]
336335
importer.job_ids = ["job-1", "job-2", "job-3"]
337336
importer.migration_report = Mock()
338337
importer._translate_stats_to_migration_report = MethodType(
@@ -348,13 +347,6 @@ def test_translate_stats_to_migration_report(self):
348347
assert set_values[("GeneralStatistics", "Records sent to Data Import")] == 10000
349348
assert set_values[("GeneralStatistics", "Data Import jobs created")] == 3
350349

351-
# Verify files were added to report
352-
add_calls = importer.migration_report.add.call_args_list
353-
added_files = [call[0][1] for call in add_calls if call[0][0] == "FilesProcessed"]
354-
assert "bibs1.mrc" in added_files
355-
assert "bibs2.mrc" in added_files
356-
357-
358350
def test_translate_stats_single_file(self):
359351
"""Test stats translation with a single file."""
360352
importer = Mock(spec=MARCImportTask)

tests/test_user_importer.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ def test_translate_stats_to_migration_report(self):
282282
failed=50,
283283
)
284284
importer.total_records = 1000
285-
importer.files_processed = ["users1.json", "users2.json"]
286285
importer.migration_report = Mock()
287286
importer._translate_stats_to_migration_report = MethodType(
288287
UserImportTask._translate_stats_to_migration_report, importer
@@ -300,12 +299,6 @@ def test_translate_stats_to_migration_report(self):
300299
assert set_values[("GeneralStatistics", "Users updated")] == 150
301300
assert set_values[("GeneralStatistics", "Users failed")] == 50
302301

303-
# Verify files were added to report
304-
add_calls = importer.migration_report.add.call_args_list
305-
added_files = [call[0][1] for call in add_calls if call[0][0] == "FilesProcessed"]
306-
assert "users1.json" in added_files
307-
assert "users2.json" in added_files
308-
309302
def test_translate_stats_all_successful(self):
310303
"""Test stats translation when all users succeed."""
311304
from folio_data_import.UserImport import UserImporterStats

0 commit comments

Comments
 (0)