()
| 17 | |
| 18 | |
| 19 | def test_format_using_callable(): |
| 20 | # test using callable by slightly incrementing above label example |
| 21 | |
| 22 | def show_three_decimal_places(value): |
| 23 | return f'{value:.3f}' |
| 24 | |
| 25 | s = Sankey(flows=[0.25], labels=['First'], orientations=[-1], |
| 26 | format=show_three_decimal_places) |
| 27 | |
| 28 | assert s.diagrams[0].texts[0].get_text() == 'First\n0.250' |
| 29 | |
| 30 | |
| 31 | @pytest.mark.parametrize('kwargs, msg', ( |