| 123456789101112131415161718192021222324252627 |
- import unittest
- from concurrent.futures import Future
- from step2_analysis.analyzer import _DeepAnalyzer
- class Step2AnalyzerOrderingTests(unittest.TestCase):
- def test_collect_futures_preserves_chunk_order_not_completion_order(self):
- first = Future()
- second = Future()
- first.set_result([{"name": "第一块"}])
- second.set_result([{"name": "第二块"}])
- items = _DeepAnalyzer._collect_futures(
- {second: 1, first: 0},
- "评分细则",
- total_chunks=2,
- )
- self.assertEqual(
- [item["name"] for item in items],
- ["第一块", "第二块"],
- )
- if __name__ == "__main__":
- unittest.main()
|