[misc] Remove unit test cases that fail the admission criteria (round 2) (#30703)

This commit is contained in:
Liangsheng Yin
2026-07-09 16:35:59 -07:00
committed by GitHub
parent b86466d54b
commit a36c873147
24 changed files with 29 additions and 770 deletions
@@ -604,77 +604,6 @@ class TestHunyuanDetectorStructureInfo(CustomTestCase):
self.assertFalse(self.detector.supports_structural_tag())
class TestHunyuanDetectorAccuracy(CustomTestCase):
"""Accuracy tests for realistic HYV3 output patterns."""
def setUp(self):
self.tools = _make_tools()
self.detector = HunyuanDetector()
def test_reference_zero_arg_inline(self):
out = (
"<tool_calls><tool_call>get_current_date<tool_sep></tool_call></tool_calls>"
)
r = self.detector.detect_and_parse(out, self.tools)
self.assertEqual(len(r.calls), 1)
self.assertEqual(r.calls[0].name, "get_current_date")
self.assertEqual(json.loads(r.calls[0].parameters), {})
self.assertEqual(r.normal_text, "")
def test_reference_zero_arg_newline(self):
out = "<tool_calls>\n<tool_call>get_current_date<tool_sep>\n</tool_call>\n</tool_calls>"
r = self.detector.detect_and_parse(out, self.tools)
self.assertEqual(len(r.calls), 1)
self.assertEqual(r.calls[0].name, "get_current_date")
def test_reference_args_same_line(self):
out = (
"<tool_calls><tool_call>get_weather<tool_sep><arg_key>city</arg_key><arg_value>Beijing"
"</arg_value><arg_key>date</arg_key><arg_value>2026-03-30</arg_value></tool_call></tool_calls>"
)
r = self.detector.detect_and_parse(out, self.tools)
self.assertEqual(len(r.calls), 1)
args = json.loads(r.calls[0].parameters)
self.assertEqual(args, {"city": "Beijing", "date": "2026-03-30"})
def test_reference_args_with_newlines(self):
out = (
"<tool_calls>\n<tool_call>get_weather<tool_sep>\n<arg_key>city</arg_key>\n<arg_value>Beijing"
"</arg_value>\n<arg_key>date</arg_key>\n<arg_value>2026-03-30</arg_value>\n</tool_call>\n</tool_calls>"
)
r = self.detector.detect_and_parse(out, self.tools)
self.assertEqual(len(r.calls), 1)
args = json.loads(r.calls[0].parameters)
self.assertEqual(args, {"city": "Beijing", "date": "2026-03-30"})
def test_reference_content_before(self):
out = "Checking.<tool_calls>\n<tool_call>get_current_date<tool_sep>\n</tool_call>\n</tool_calls>"
r = self.detector.detect_and_parse(out, self.tools)
self.assertEqual(len(r.calls), 1)
self.assertEqual(r.normal_text, "Checking.")
def test_reference_multiple(self):
out = (
"<tool_calls>\n<tool_call>get_weather<tool_sep>\n<arg_key>city</arg_key>\n<arg_value>Beijing"
"</arg_value>\n<arg_key>date</arg_key>\n<arg_value>2026-03-30</arg_value>\n</tool_call>\n"
"<tool_call>get_weather<tool_sep>\n<arg_key>city</arg_key>\n<arg_value>Hangzhou</arg_value>\n"
"<arg_key>date</arg_key>\n<arg_value>2026-03-30</arg_value>\n</tool_call>\n</tool_calls>"
)
r = self.detector.detect_and_parse(out, self.tools)
self.assertEqual(len(r.calls), 2)
def test_reference_empty_content_none(self):
out = "<tool_calls>\n<tool_call>get_current_date<tool_sep>\n</tool_call>\n</tool_calls>"
r = self.detector.detect_and_parse(out, self.tools)
self.assertEqual(r.normal_text, "")
def test_reference_no_tool_call(self):
out = "This is a plain response."
r = self.detector.detect_and_parse(out, self.tools)
self.assertEqual(len(r.calls), 0)
self.assertEqual(r.normal_text, out)
class TestHunyuanDetectorFunctionCallParser(CustomTestCase):
"""Test through the FunctionCallParser interface."""