Seems to mostly work now. Regular matching is still wrong
This commit is contained in:
@@ -142,7 +142,7 @@ class TestConversionServiceWithImportedData:
|
||||
|
||||
## 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, hotel_id="39054_001")
|
||||
stats = await conversion_service.process_conversion_xml(xml_content)
|
||||
|
||||
# BASELINE ASSERTIONS:
|
||||
@@ -224,7 +224,7 @@ class TestConversionServiceWithImportedData:
|
||||
# File already has proper XML structure, just use it as-is
|
||||
xml_content = xml_content.strip()
|
||||
|
||||
conversion_service = ConversionService(test_db_session)
|
||||
conversion_service = ConversionService(test_db_session, hotel_id="39054_001")
|
||||
stats = await conversion_service.process_conversion_xml(xml_content)
|
||||
|
||||
# Verify conversions were created
|
||||
@@ -300,7 +300,7 @@ class TestConversionServiceWithImportedData:
|
||||
# File already has proper XML structure, just use it as-is
|
||||
xml_content = xml_content.strip()
|
||||
|
||||
conversion_service = ConversionService(test_db_session)
|
||||
conversion_service = ConversionService(test_db_session, hotel_id="39054_001")
|
||||
stats = await conversion_service.process_conversion_xml(xml_content)
|
||||
|
||||
# Verify conversions were processed
|
||||
@@ -332,7 +332,7 @@ class TestConversionServiceWithImportedData:
|
||||
"""Test ConversionService handles invalid XML gracefully."""
|
||||
invalid_xml = "<invalid>unclosed tag"
|
||||
|
||||
conversion_service = ConversionService(test_db_session)
|
||||
conversion_service = ConversionService(test_db_session, hotel_id="39054_001")
|
||||
|
||||
with pytest.raises(ValueError, match="Invalid XML"):
|
||||
await conversion_service.process_conversion_xml(invalid_xml)
|
||||
@@ -342,7 +342,7 @@ class TestConversionServiceWithImportedData:
|
||||
"""Test ConversionService handles empty/minimal XML."""
|
||||
minimal_xml = '<?xml version="1.0"?><root></root>'
|
||||
|
||||
conversion_service = ConversionService(test_db_session)
|
||||
conversion_service = ConversionService(test_db_session, hotel_id="39054_001")
|
||||
stats = await conversion_service.process_conversion_xml(minimal_xml)
|
||||
|
||||
assert stats["total_reservations"] == 0
|
||||
@@ -421,7 +421,7 @@ class TestConversionServiceWithImportedData:
|
||||
xml_content1 = multi_builder1.build_xml()
|
||||
|
||||
# Process first batch
|
||||
service = ConversionService(test_db_session)
|
||||
service = ConversionService(test_db_session, hotel_id="39054_001")
|
||||
stats1 = await service.process_conversion_xml(xml_content1)
|
||||
|
||||
assert stats1["total_reservations"] == 2
|
||||
@@ -577,7 +577,7 @@ class TestXMLBuilderUsage:
|
||||
)
|
||||
|
||||
# Process the XML
|
||||
service = ConversionService(test_db_session)
|
||||
service = ConversionService(test_db_session, hotel_id="39054_001")
|
||||
stats = await service.process_conversion_xml(xml_content)
|
||||
|
||||
assert stats["total_reservations"] == 1
|
||||
@@ -616,7 +616,7 @@ class TestXMLBuilderUsage:
|
||||
.build_xml()
|
||||
)
|
||||
|
||||
service = ConversionService(test_db_session)
|
||||
service = ConversionService(test_db_session, hotel_id="39054_001")
|
||||
stats = await service.process_conversion_xml(xml_content)
|
||||
|
||||
assert stats["total_reservations"] == 1
|
||||
@@ -677,7 +677,7 @@ class TestXMLBuilderUsage:
|
||||
xml_content = multi_builder.build_xml()
|
||||
|
||||
# Process the XML
|
||||
service = ConversionService(test_db_session)
|
||||
service = ConversionService(test_db_session, hotel_id="39054_001")
|
||||
stats = await service.process_conversion_xml(xml_content)
|
||||
|
||||
assert stats["total_reservations"] == 2
|
||||
@@ -768,7 +768,7 @@ class TestHashedMatchingLogic:
|
||||
</reservation>
|
||||
</root>"""
|
||||
|
||||
service = ConversionService(test_db_session, hotel_id="hotel_1")
|
||||
service = ConversionService(test_db_session, hotel_id="39054_001")
|
||||
stats = await service.process_conversion_xml(xml_content)
|
||||
|
||||
# Verify conversion was created
|
||||
|
||||
Reference in New Issue
Block a user