2 Commits

Author SHA1 Message Date
Jonas Linter
ae73a1b761 Merge branch 'conversion_test_initial' 2025-11-19 14:30:42 +01:00
Jonas Linter
12b67dc353 Fixed the incorrect conversion_service test 2025-11-19 14:29:58 +01:00

View File

@@ -77,13 +77,13 @@ def test_config():
},
"alpine_bits_auth": [
{
"hotel_id": "bemelmans",
"hotel_id": "39054_001",
"hotel_name": "Bemelmans Apartments",
"username": "bemelmans_user",
"password": "testpass",
}
],
"default_hotel_code": "bemelmans",
"default_hotel_code": "39054_001",
"default_hotel_name": "Bemelmans Apartments",
}
@@ -124,7 +124,7 @@ class TestConversionServiceWithImportedData:
importer = CSVImporter(test_db_session, test_config)
csv_stats = await importer.import_csv_file(
csv_file_path=str(csv_file),
hotel_code="bemelmans",
hotel_code="39054_001",
dryrun=False,
)
@@ -141,6 +141,8 @@ class TestConversionServiceWithImportedData:
# File already has proper XML structure, just use it as-is
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)
stats = await conversion_service.process_conversion_xml(xml_content)
@@ -157,7 +159,7 @@ class TestConversionServiceWithImportedData:
EXPECTED_TOTAL_ROOMS = 539
# 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.
EXPECTED_MATCHED_TO_RESERVATION = 0
EXPECTED_MATCHED_TO_RESERVATION = 19
print(f"\nBaseline Match Counts:")
print(f" Total reservations in XML: {EXPECTED_TOTAL_RESERVATIONS}")
@@ -195,7 +197,7 @@ class TestConversionServiceWithImportedData:
importer = CSVImporter(test_db_session, test_config)
await importer.import_csv_file(
csv_file_path=str(csv_file),
hotel_code="bemelmans",
hotel_code="39054_001",
dryrun=False,
)
@@ -265,7 +267,7 @@ class TestConversionServiceWithImportedData:
importer = CSVImporter(test_db_session, test_config)
csv_stats = await importer.import_csv_file(
csv_file_path=str(csv_file),
hotel_code="bemelmans",
hotel_code="39054_001",
dryrun=False,
)