def test_tuple(encoder):
assert encoder.encode(("_AUTO_", None)) == "_AUTO_"
assert encoder.encode(("_AUTOBLOCKER_", None)) == "_AUTOBLOCKER_"
assert encoder.encode(("_AUTO_", True)) == "_AUTO_: DEFAULT=true"
assert encoder.encode(("_AUTO_", 3)) == "_AUTO_: DEFAULT=3"
assert encoder.encode(("_AUTO_", 3.14)) == "_AUTO_: DEFAULT=3.14"
assert encoder.encode(("_AUTO_", "text")) == "_AUTO_: DEFAULT=text"
assert encoder.encode(("_AUTO_", "'text'")) == "_AUTO_: DEFAULT='text'"
assert encoder.encode(("_AUTO_", '"text"')) == '_AUTO_: DEFAULT="text"'
with pytest.raises(ValueError, match="len=2"):
assert encoder.encode(())
with pytest.raises(ValueError, match="len=2"):
assert encoder.encode(("_AUTO_",))
with pytest.raises(ValueError, match="len=2"):
assert encoder.encode(("_AUTO_", None, None))
with pytest.raises(ValueError, match="First element"):
assert encoder.encode(("AUTO", None))
with pytest.raises(ValueError, match="First element"):
assert encoder.encode((None, None))
with pytest.raises(TypeError, match="Second element"):
assert encoder.encode(("_AUTO_", ()))
with pytest.raises(TypeError, match="Second element"):
assert encoder.encode(("_AUTO_", (1, 2, 3)))
with pytest.raises(TypeError, match="Second element"):
assert encoder.encode(("_AUTO_", {}))
with pytest.raises(TypeError, match="Second element"):
assert encoder.encode(("_AUTO_", {"k1": 1, "k2": 2, "k3": 3}))
with pytest.raises(TypeError, match="Second element"):
assert encoder.encode(("_AUTO_", []))
with pytest.raises(TypeError, match="Second element"):
assert encoder.encode(("_AUTO_", [1, 2, 3]))