This commit is contained in:
@@ -67,6 +67,11 @@ class RiskAgentTests(unittest.TestCase):
|
||||
def test_model_never_calls_external_url(self):
|
||||
with patch.dict("os.environ",{"XINGBANG_LOCAL_MODEL_URL":"https://example.com/v1"}):
|
||||
with self.assertRaises(ValueError):engine.local_model({}, {}, {})
|
||||
def test_official_deepseek_model_url_is_allowed(self):
|
||||
with patch.dict("os.environ",{"XINGBANG_LOCAL_MODEL_URL":"https://api.deepseek.com"}), patch("graph.risk_task.invoke_risk_task",return_value={"text":"ok"}) as invoke:
|
||||
result=engine.local_model({}, {}, {})
|
||||
self.assertEqual(result,{"text":"ok"})
|
||||
self.assertEqual(invoke.call_args.args[3],"https://api.deepseek.com")
|
||||
def test_crud_custom_skill(self):
|
||||
response=self.client.post(self.base+"/skills",json={"name":"新检查","data":{"engine":"quality","inputs":["*"],"output":"quality"}})
|
||||
self.assertEqual(response.status_code,200,response.text)
|
||||
|
||||
Reference in New Issue
Block a user