11import os
22import sys
33import pytest
4- from unittest .mock import AsyncMock , MagicMock
4+ from unittest .mock import MagicMock
55from autogen_core .components .tools import FunctionTool
66
7- sys .modules [' azure.monitor.events.extension' ] = MagicMock ()
7+ sys .modules [" azure.monitor.events.extension" ] = MagicMock ()
88
99# Set environment variables to mock Config dependencies before any import
1010os .environ ["COSMOSDB_ENDPOINT" ] = "https://mock-endpoint"
3636 configure_server ,
3737 grant_database_access ,
3838 provide_tech_training ,
39- resolve_technical_issue ,
4039 configure_printer ,
4140 set_up_email_signature ,
4241 configure_mobile_device ,
43- manage_software_licenses ,
4442 set_up_remote_desktop ,
4543 troubleshoot_hardware_issue ,
4644 manage_network_security ,
@@ -80,25 +78,29 @@ async def test_send_welcome_email():
8078 assert "John Doe" in result
8179 assert "[email protected] " in result 8280
81+
8382@pytest .mark .asyncio
8483async def test_set_up_office_365_account ():
8584 result = await set_up_office_365_account (
"Jane Smith" ,
"[email protected] " )
8685 assert "Office 365 Account Setup" in result
8786 assert "Jane Smith" in result
8887 assert "[email protected] " in result 8988
89+
9090@pytest .mark .asyncio
9191async def test_configure_laptop ():
9292 result = await configure_laptop ("John Doe" , "Dell XPS 15" )
9393 assert "Laptop Configuration" in result
9494 assert "Dell XPS 15" in result
9595
96+
9697@pytest .mark .asyncio
9798async def test_reset_password ():
9899 result = await reset_password ("John Doe" )
99100 assert "Password Reset" in result
100101 assert "John Doe" in result
101102
103+
102104@pytest .mark .asyncio
103105async def test_setup_vpn_access ():
104106 result = await setup_vpn_access ("John Doe" )
@@ -147,12 +149,14 @@ async def test_assist_procurement_with_tech_equipment():
147149 assert "Technical Specifications Provided" in result
148150 assert "Dell Workstation specs" in result
149151
152+
150153@pytest .mark .asyncio
151154async def test_provide_tech_support_for_marketing ():
152155 result = await provide_tech_support_for_marketing ("Holiday Campaign" )
153156 assert "Tech Support for Marketing Campaign" in result
154157 assert "Holiday Campaign" in result
155158
159+
156160@pytest .mark .asyncio
157161async def test_assist_product_launch ():
158162 result = await assist_product_launch ("Smartphone X" )
@@ -220,6 +224,7 @@ async def test_configure_mobile_device():
220224 assert "Emily" in result
221225 assert "iPhone 13" in result
222226
227+
223228@pytest .mark .asyncio
224229async def test_set_up_remote_desktop ():
225230 result = await set_up_remote_desktop ("Frank" )
@@ -261,6 +266,7 @@ async def test_manage_it_inventory():
261266 result = await manage_it_inventory ()
262267 assert "IT Inventory Managed" in result
263268
269+
264270@pytest .mark .asyncio
265271async def test_configure_firewall_rules ():
266272 result = await configure_firewall_rules ("Allow traffic on port 8080" )
@@ -336,7 +342,9 @@ async def test_manage_system_updates():
336342
337343@pytest .mark .asyncio
338344async def test_configure_digital_signatures ():
339- result = await configure_digital_signatures ("John Doe" , "Company Approved Signature" )
345+ result = await configure_digital_signatures (
346+ "John Doe" , "Company Approved Signature"
347+ )
340348 assert "Digital Signatures Configured" in result
341349 assert "John Doe" in result
342350 assert "Company Approved Signature" in result
@@ -373,4 +381,4 @@ def test_get_tech_support_tools():
373381 tools = get_tech_support_tools ()
374382 assert isinstance (tools , list )
375383 assert len (tools ) > 40 # Ensure all tools are included
376- assert all (isinstance (tool , FunctionTool ) for tool in tools )
384+ assert all (isinstance (tool , FunctionTool ) for tool in tools )
0 commit comments