@@ -25,45 +25,45 @@ async def test_http_client_lifecycle():
2525 # Test 1: Client should not be initialized initially
2626 try :
2727 get_http_client ()
28- print ("❌ FAIL: Expected RuntimeError when client not initialized" )
28+ print ("FAIL: Expected RuntimeError when client not initialized" )
2929 return False
3030 except RuntimeError as e :
31- print (f"✅ PASS: Got expected error when client not initialized: { e } " )
31+ print (f"PASS: Got expected error when client not initialized: { e } " )
3232
3333 # Test 2: Initialize client
3434 await initialize_http_client ()
35- print ("✅ PASS: HTTP client initialized" )
35+ print ("PASS: HTTP client initialized" )
3636
3737 # Test 3: Client should be available now
3838 try :
3939 client = get_http_client ()
40- print (f"✅ PASS: Got HTTP client: { type (client ).__name__ } " )
40+ print (f"PASS: Got HTTP client: { type (client ).__name__ } " )
4141 except Exception as e :
42- print (f"❌ FAIL: Could not get HTTP client after initialization: { e } " )
42+ print (f"FAIL: Could not get HTTP client after initialization: { e } " )
4343 return False
4444
4545 # Test 4: Test multiple initializations (should be safe)
4646 await initialize_http_client ()
4747 client2 = get_http_client ()
4848 if client is client2 :
49- print ("✅ PASS: Multiple initializations return same client instance" )
49+ print ("PASS: Multiple initializations return same client instance" )
5050 else :
51- print ("❌ FAIL: Multiple initializations created different clients" )
51+ print ("FAIL: Multiple initializations created different clients" )
5252 return False
5353
5454 # Test 5: Cleanup client
5555 await cleanup_http_client ()
56- print ("✅ PASS: HTTP client cleaned up" )
56+ print ("PASS: HTTP client cleaned up" )
5757
5858 # Test 6: Client should not be available after cleanup
5959 try :
6060 get_http_client ()
61- print ("❌ FAIL: Expected RuntimeError after cleanup" )
61+ print ("FAIL: Expected RuntimeError after cleanup" )
6262 return False
6363 except RuntimeError as e :
64- print (f"✅ PASS: Got expected error after cleanup: { e } " )
64+ print (f"PASS: Got expected error after cleanup: { e } " )
6565
66- print ("\n 🎉 All HTTP client lifecycle tests passed!" )
66+ print ("\n All HTTP client lifecycle tests passed!" )
6767 return True
6868
6969
@@ -78,20 +78,20 @@ async def test_activity_integration():
7878 # This will fail because the expense server isn't running,
7979 # but it will test that the HTTP client is accessible
8080 await create_expense_activity ("test-expense-123" )
81- print ("❌ Unexpected: Activity succeeded (expense server must be running)" )
81+ print ("Unexpected: Activity succeeded (expense server must be running)" )
8282 except Exception as e :
8383 # We expect this to fail since expense server isn't running
8484 if "HTTP client not initialized" in str (e ):
85- print ("❌ FAIL: HTTP client not accessible in activity" )
85+ print ("FAIL: HTTP client not accessible in activity" )
8686 return False
8787 else :
8888 print (
89- f"✅ PASS: Activity accessed HTTP client correctly (failed as expected due to no server): { type (e ).__name__ } "
89+ f"PASS: Activity accessed HTTP client correctly (failed as expected due to no server): { type (e ).__name__ } "
9090 )
9191
9292 # Cleanup
9393 await cleanup_http_client ()
94- print ("✅ PASS: Activity integration test completed" )
94+ print ("PASS: Activity integration test completed" )
9595 return True
9696
9797
@@ -107,11 +107,11 @@ async def main():
107107 print ("\n " + "=" * 60 )
108108 if test1_passed and test2_passed :
109109 print (
110- "🎉 ALL TESTS PASSED! HTTP client lifecycle management is working correctly."
110+ "ALL TESTS PASSED! HTTP client lifecycle management is working correctly."
111111 )
112112 return 0
113113 else :
114- print ("❌ SOME TESTS FAILED! Please check the implementation." )
114+ print ("SOME TESTS FAILED! Please check the implementation." )
115115 return 1
116116
117117
0 commit comments