Пример #1
0
 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, []) 
Пример #2
0
 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, []) 
Пример #3
0
 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)
Пример #4
0
 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, [])
Пример #5
0
 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, [])
Пример #6
0
 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)
Пример #7
0
 def test(self):
     """Test basic construction"""
     n = PosixNamingStrategy()
     self.assertNotEqual(n, None)