How can this be tested? Perhaps by catching the exception when something other than `Add`, `Mul` or `Symbol` is given? What is the accepted method to do such a thing in SymPy?