@@ -0,0 +1,873 @@
+import os%0Aimport tempfile%0A%0A%0Aclass SrcDstDirMixin():%0A  %22%22%22Fixture mixin for tests that need source and destination dirs.%0A%0A  TODO: Make this class catch unexpected writes to the source%0A  directory.%0A  %22%22%22%0A%0A  def setUp(self):%0A    self.__src = tempfile.TemporaryDirectory()%0A    self.__dst = tempfile.TemporaryDirectory()%0A%0A  def tearDown(self):%0A    self.__src.cleanup()%0A    self.__dst.cleanup()%0A%0A  def src_path(self):%0A    return self.__src.name%0A%0A  def dst_path(self):%0A    return self.__dst.name%0A%0A%0Adef get_preserved_attrs(filename):%0A  %22%22%22Get what should be preserved when a file/dir is unchanged.%0A  %22%22%22%0A%0A  stat = os.lstat(filename)%0A  return (stat.st_mode, stat.st_mtime)%0A%0Adef symlink_pointee_abspath(filename):%0A  %22%22%22Get the abspath of what's pointed to by the given symlink.%0A  %22%22%22%0A%0A  return os.path.abspath(os.path.join(%0A    os.path.dirname(filename),%0A    os.readlink(filename)))%0A

Add helpers for tests.