tests: rework tests to use generators