tech-bid-manageV1.120260424/tests/test_bid_appendix_content.py
2026-04-24 14:44:38 +08:00

43 lines
1.5 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""标准附件:工期解析、清单节点、总平面与临时用地勾连。"""
import unittest
from utils import bid_appendix_content as bac
class TestBidAppendixSchedule(unittest.TestCase):
def test_parse_duration(self):
t = '本工程工期为 180 日历天,自合同签订起算。'
self.assertEqual(bac._parse_duration_calendar_days(t), 180)
def test_parse_schedule_dates(self):
s = '计划开工日期2026年5月1日。计划完工日期2026年10月28日。'
sch = bac._parse_schedule_facts(s, '')
self.assertEqual(sch['start'], '2026年5月1日')
self.assertEqual(sch['end'], '2026年10月28日')
def test_boq_nodes_from_table(self):
boq = """
| 序号 | 项目名称 | 单位 |
|------|----------|------|
| 1 | 挖一般土方 | m3 |
| 2 | 现浇混凝土柱 | m3 |
"""
nodes = bac._extract_boq_work_items('', boq)
self.assertIn('挖一般土方', nodes)
self.assertIn('现浇混凝土柱', nodes)
def test_site_layout_links_temp_land(self):
md = bac._build_site_layout_figure_md('施工总平面图', '含材料堆场', '')
self.assertIn('临时用地表', md)
self.assertIn('材料堆场', md)
self.assertIn('', md)
def test_schedule_figure_no_fantasy_when_empty(self):
md = bac._build_schedule_figure_md('进度网络图', '', '')
self.assertIn('不填写具体开工日', md)
self.assertIn('不得臆造', md)
if __name__ == '__main__':
unittest.main()