Change test to use set() comparison and add docstring

Using set because and os.listdir() does not guarantee ordering.