I'm not sure it's necessary to create each directory one at a time and check to make sure `list_application_instances` is still returning empty. I'd imagine one test with directories but no files would be enough to ensure that it "does not return directories."

Just a suggestion. You know the code better than I, and therefore what need be tested!