@@ -61,8 +61,22 @@ async def test_init_webhook_server_args_host_type(self):
61
61
)
62
62
63
63
@pytest .mark .asyncio
64
- async def test_init_webhook_server_args_host_non_empty (self ):
65
- with pytest .raises (AssertionError ):
64
+ async def test_init_webhook_server_invalid_ip (self ):
65
+ with pytest .raises (
66
+ ValueError , match = "does not appear to be an IPv4 or IPv6 address"
67
+ ):
68
+ ac = AriesAgentController (admin_url = self .admin_url , is_multitenant = True )
69
+ await ac .init_webhook_server (
70
+ webhook_host = "12345.123456.1234.0" ,
71
+ webhook_port = 1234 ,
72
+ webhook_base = self .webhook_base ,
73
+ )
74
+
75
+ @pytest .mark .asyncio
76
+ async def test_init_webhook_server_empty_invalid_ip (self ):
77
+ with pytest .raises (
78
+ ValueError , match = "does not appear to be an IPv4 or IPv6 address"
79
+ ):
66
80
ac = AriesAgentController (admin_url = self .admin_url , is_multitenant = True )
67
81
await ac .init_webhook_server (
68
82
webhook_host = "" , webhook_port = 1234 , webhook_base = self .webhook_base
@@ -73,7 +87,9 @@ async def test_init_webhook_server_args_port(self):
73
87
with pytest .raises (AssertionError ):
74
88
ac = AriesAgentController (admin_url = self .admin_url , is_multitenant = True )
75
89
await ac .init_webhook_server (
76
- webhook_host = "" , webhook_port = "1234" , webhook_base = self .webhook_base
90
+ webhook_host = self .webhook_host ,
91
+ webhook_port = "1234" ,
92
+ webhook_base = self .webhook_base ,
77
93
)
78
94
79
95
@pytest .mark .asyncio
0 commit comments