#!/usr/bin/env python # -*- coding: utf-8 -*- from online_dev.report_manager.engine.polymerize import build_bind_list def test_group_bind(): cell = { "custom": { "field": "category", "polymerizationType": "2", "groupType": "default", } } rows = [ {"category": "A", "x": 1}, {"category": "B", "x": 2}, {"category": "A", "x": 3}, ] binds = build_bind_list(cell, rows) assert len(binds) == 2 assert binds[0].value == "A" assert len(binds[0].data_list) == 2 if __name__ == "__main__": test_group_bind() print("ok")