Fix test which didn't mock irods

Our test didn't mock irods, which meant that it
would pass falsely. Fixed the test and the
revealed bug.