def testAbsolutePathFileCopy(self): """Test copying to /dev/zero to /dev/null""" n = PosixNamingStrategy() (rc, dirs, files, links) = n.buildDirsFilesLinks('/dev/zero', '/dev/null', targetExists=True, targetIsDir=False) self.assertEqual(rc, 0) self.assertEqual(dirs, []) self.assertEqual(files, [('/dev/zero', '/dev/null')]) self.assertEqual(links, [])
def testRelativeDirFileCopy(self): """Test copying a file to '..'""" n = PosixNamingStrategy() (rc, dirs, files, links) = n.buildDirsFilesLinks('Makefile', '..', targetExists=True, targetIsDir=True) self.assertEqual(rc, 0) self.assertEqual(dirs, []) self.assertEqual(files, [('Makefile', '../Makefile')]) self.assertEqual(links, [])
def buildWalk(self, source, target, targetExists, targetIsDir): """ @return a (rc, dirs, files, symlinks) tuple rc is 0 on success dirs is the list of source dirs to create files is a list of (sourcename, sinkname) tuples links is a list of (target, sinkname) tuples """ namer = PosixNamingStrategy() return namer.buildDirsFilesLinks(source, target, targetExists, targetIsDir)
def test(self): """Test basic construction""" n = PosixNamingStrategy() self.assertNotEqual(n, None)