sort os.listxattr results before comparing it to avoid depending on the ordering of the directory information in the underlying filesystem.

This commit is contained in:
Gregory P. Smith 2014-01-17 12:01:40 -08:00
commit 4cfbac80bd
1 changed files with 1 additions and 1 deletions

View File

@ -431,7 +431,7 @@ class TestShutil(unittest.TestCase):
os.setxattr(src, 'user.foo', b'42')
os.setxattr(src, 'user.bar', b'43')
shutil._copyxattr(src, dst)
self.assertEqual(os.listxattr(src), os.listxattr(dst))
self.assertEqual(sorted(os.listxattr(src)), sorted(os.listxattr(dst)))
self.assertEqual(
os.getxattr(src, 'user.foo'),
os.getxattr(dst, 'user.foo'))