| 115 | |
| 116 | |
| 117 | def test_str_accessor_cat(ser, dser): |
| 118 | sol = ser.str.cat(ser.str.upper(), sep=":") |
| 119 | assert_eq(dser.str.cat(dser.str.upper(), sep=":"), sol) |
| 120 | assert_eq(dser.str.cat(ser.str.upper(), sep=":"), sol) |
| 121 | assert_eq( |
| 122 | dser.str.cat([dser.str.upper(), ser.str.lower()], sep=":"), |
| 123 | ser.str.cat([ser.str.upper(), ser.str.lower()], sep=":"), |
| 124 | ) |
| 125 | assert_eq(dser.str.cat(sep=":"), ser.str.cat(sep=":")) |
| 126 | |
| 127 | for o in ["foo", ["foo"]]: |
| 128 | with pytest.raises(TypeError): |
| 129 | dser.str.cat(o) |
| 130 | |
| 131 | |
| 132 | @pytest.mark.parametrize("index", [None, [0]], ids=["range_index", "other index"]) |