Fixed the incorrect conversion_service test

This commit is contained in:
Jonas Linter
2025-11-19 14:29:58 +01:00
parent 90f68bfd26
commit 12b67dc353

View File

@@ -66,13 +66,13 @@ def test_config():
}, },
"alpine_bits_auth": [ "alpine_bits_auth": [
{ {
"hotel_id": "bemelmans", "hotel_id": "39054_001",
"hotel_name": "Bemelmans Apartments", "hotel_name": "Bemelmans Apartments",
"username": "bemelmans_user", "username": "bemelmans_user",
"password": "testpass", "password": "testpass",
} }
], ],
"default_hotel_code": "bemelmans", "default_hotel_code": "39054_001",
"default_hotel_name": "Bemelmans Apartments", "default_hotel_name": "Bemelmans Apartments",
} }
@@ -113,7 +113,7 @@ class TestConversionServiceWithImportedData:
importer = CSVImporter(test_db_session, test_config) importer = CSVImporter(test_db_session, test_config)
csv_stats = await importer.import_csv_file( csv_stats = await importer.import_csv_file(
csv_file_path=str(csv_file), csv_file_path=str(csv_file),
hotel_code="bemelmans", hotel_code="39054_001",
dryrun=False, dryrun=False,
) )
@@ -130,6 +130,8 @@ class TestConversionServiceWithImportedData:
# File already has proper XML structure, just use it as-is # File already has proper XML structure, just use it as-is
xml_content = xml_content.strip() xml_content = xml_content.strip()
## Need to check if reservations and customers are now actually available in the db before proceeding
conversion_service = ConversionService(test_db_session) conversion_service = ConversionService(test_db_session)
stats = await conversion_service.process_conversion_xml(xml_content) stats = await conversion_service.process_conversion_xml(xml_content)
@@ -146,7 +148,7 @@ class TestConversionServiceWithImportedData:
EXPECTED_TOTAL_ROOMS = 539 EXPECTED_TOTAL_ROOMS = 539
# Note: Currently no matches by tracking ID because XML data uses different formats # Note: Currently no matches by tracking ID because XML data uses different formats
# This is expected with the test data. Real PMS data would have higher match rates. # This is expected with the test data. Real PMS data would have higher match rates.
EXPECTED_MATCHED_TO_RESERVATION = 0 EXPECTED_MATCHED_TO_RESERVATION = 19
print(f"\nBaseline Match Counts:") print(f"\nBaseline Match Counts:")
print(f" Total reservations in XML: {EXPECTED_TOTAL_RESERVATIONS}") print(f" Total reservations in XML: {EXPECTED_TOTAL_RESERVATIONS}")
@@ -184,7 +186,7 @@ class TestConversionServiceWithImportedData:
importer = CSVImporter(test_db_session, test_config) importer = CSVImporter(test_db_session, test_config)
await importer.import_csv_file( await importer.import_csv_file(
csv_file_path=str(csv_file), csv_file_path=str(csv_file),
hotel_code="bemelmans", hotel_code="39054_001",
dryrun=False, dryrun=False,
) )
@@ -254,7 +256,7 @@ class TestConversionServiceWithImportedData:
importer = CSVImporter(test_db_session, test_config) importer = CSVImporter(test_db_session, test_config)
csv_stats = await importer.import_csv_file( csv_stats = await importer.import_csv_file(
csv_file_path=str(csv_file), csv_file_path=str(csv_file),
hotel_code="bemelmans", hotel_code="39054_001",
dryrun=False, dryrun=False,
) )