Refactor test (minor): use namedtuple for stub