You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.0 KiB
Python
29 lines
1.0 KiB
Python
|
|
import asyncio
|
|
from src.database.core import async_session
|
|
from src.fmea.service import match_pfi_equipment
|
|
|
|
async def test():
|
|
session = async_session()
|
|
try:
|
|
# Test 1: ID Fan
|
|
print("Testing: INDUCED DRAFT FAN A")
|
|
res1 = await match_pfi_equipment(db_session=session, pfi_name="INDUCED DRAFT FAN A")
|
|
print(f"Matched: {res1['matched_equipments']} | By: {res1['matched_by']}")
|
|
|
|
# Test 2: BFP
|
|
print("\nTesting: BOILER FEED PUMP TURBINE A")
|
|
res2 = await match_pfi_equipment(db_session=session, pfi_name="BOILER FEED PUMP TURBINE A")
|
|
print(f"Matched: {res2['matched_equipments']} | By: {res2['matched_by']}")
|
|
|
|
# Test 3: Tag match
|
|
print("\nTesting tag: 3GG-F801A")
|
|
res3 = await match_pfi_equipment(db_session=session, pfi_name="IDF", pfi_tag="3GG-F801A")
|
|
print(f"Matched: {res3['matched_equipments']} | By: {res3['matched_by']}")
|
|
|
|
finally:
|
|
await session.close()
|
|
|
|
if __name__ == '__main__':
|
|
asyncio.run(test())
|