(styler, index, columns)
| 58 | @pytest.mark.parametrize("index", [True, False]) |
| 59 | @pytest.mark.parametrize("columns", [True, False]) |
| 60 | def test_display_format_index(styler, index, columns): |
| 61 | exp_index = ["x", "y"] |
| 62 | if index: |
| 63 | styler.format_index(lambda v: v.upper(), axis=0) # test callable |
| 64 | exp_index = ["X", "Y"] |
| 65 | |
| 66 | exp_columns = ["A", "B"] |
| 67 | if columns: |
| 68 | styler.format_index("*{}*", axis=1) # test string |
| 69 | exp_columns = ["*A*", "*B*"] |
| 70 | |
| 71 | ctx = styler._translate(True, True) |
| 72 | |
| 73 | for r, row in enumerate(ctx["body"]): |
| 74 | assert row[0]["display_value"] == exp_index[r] |
| 75 | |
| 76 | for c, col in enumerate(ctx["head"][1:]): |
| 77 | assert col["display_value"] == exp_columns[c] |
| 78 | |
| 79 | |
| 80 | def test_format_dict(styler): |
nothing calls this directly
no test coverage detected