def test_copy_in_symlink(self): copy_in(self.indata, copy_type='symlink', workdir=self.tmp_dst_dir) # here check files linked self.assertEqual(self.__dirs_content_equal(self.tmp_src_dir, self.tmp_dst_dir), 0) # check dst files are links _, stdout, _ = execute(r'find %s -type l -exec echo -n l \;' % self.tmp_dst_dir) # Python 3 (added r) self.assertEqual(stdout, ''.join('l' for i in range(self.numfiles)))
def test_copy_in_mv(self): _, stdout1, stderr1 = execute(' '.join( ['ls', self.tmp_src_dir, '|', 'grep', '-v', 'dest'])) copy_in(self.indata, copy_type='mv', workdir=self.tmp_dst_dir) # here check files moved self.assertEqual( self.__dirs_content_valid(self.tmp_src_dir, self.tmp_dst_dir, dir2_expected_content=stdout1), 0)
def test_copy_in_cp(self): copy_in(self.indata, copy_type='cp', workdir=self.tmp_dst_dir) self.assertEqual(self.__dirs_content_equal(self.tmp_src_dir, self.tmp_dst_dir), 0)