rewrite test using ddt