Merge branch 'conversion_test_initial'
This commit is contained in:
@@ -77,13 +77,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",
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,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,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -141,6 +141,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)
|
||||||
|
|
||||||
@@ -157,7 +159,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}")
|
||||||
@@ -195,7 +197,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,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -265,7 +267,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,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user