def test_rewrites(self): for v1, v2 in T_REWRITES: w = Wax() w.key = v1 w.key = v2 # ensure that values that are instances of builtin types can be # replaced with classes which inherit from a compatible type, and vice # versa. class Foo(str): pass fstr = Foo("hi") w = Wax() w.foo = "hello" w.foo = fstr w.foo = "goodbye"