mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge b2866b2630 into 25045e8fb8
This commit is contained in:
commit
52e826f746
1 changed files with 17 additions and 0 deletions
|
|
@ -491,6 +491,9 @@ class TestCopy(unittest.TestCase):
|
|||
self.assertTrue(os.path.exists(path),
|
||||
'Directory does not exist: %s' % path)
|
||||
|
||||
def _create_symlink(self, path, *name):
|
||||
os.symlink(path, os.path.join(self.root_dir, *name))
|
||||
|
||||
def test_copy_file_same_path(self):
|
||||
self._create_file('a.txt')
|
||||
utils.copy(os.path.join(self.root_dir, 'a.txt'),
|
||||
|
|
@ -547,6 +550,20 @@ class TestCopy(unittest.TestCase):
|
|||
self._exist_dir('b0', 'b1', 'b2', 'b3', 'b')
|
||||
self._exist_file('b0', 'b1', 'b2', 'b3', 'b', 'a.txt')
|
||||
|
||||
def test_copy_symlink(self):
|
||||
self._create_dir('f')
|
||||
self._create_dir('q')
|
||||
self._create_dir('q', 'r')
|
||||
self._create_file('q', 'r', 'f.txt')
|
||||
sympathy = os.path.join(self.root_dir, 'q')
|
||||
self._create_symlink(sympathy, 'f', 'q')
|
||||
utils.copy(os.path.join(self.root_dir, 'f'),
|
||||
os.path.join(self.root_dir, 'm'))
|
||||
self._exist_dir('m')
|
||||
self._exist_dir('m', 'q')
|
||||
self._exist_dir('m', 'q', 'r')
|
||||
self._exist_file('m', 'q', 'r', 'f.txt')
|
||||
|
||||
|
||||
class TestDateFormatter(unittest.TestCase):
|
||||
'''Tests that the output of DateFormatter jinja filter is same as
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue