forked from github/pelican
Merge pull request #1581 from georgevreilly/win-fixes
Fix Pelican rendering and unit tests on Windows.
This commit is contained in:
commit
bfbb7d4bb5
14 changed files with 104 additions and 52 deletions
|
|
@ -10,7 +10,7 @@ from pelican.tools.pelican_import import wp2fields, fields2pelican, decode_wp_co
|
|||
from pelican.tests.support import (unittest, temporary_folder, mute,
|
||||
skipIfNoExecutable)
|
||||
|
||||
from pelican.utils import slugify
|
||||
from pelican.utils import slugify, path_to_file_url
|
||||
|
||||
CUR_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
WORDPRESS_XML_SAMPLE = os.path.join(CUR_DIR, 'content', 'wordpressexport.xml')
|
||||
|
|
@ -294,12 +294,11 @@ class TestWordpressXMLAttachements(unittest.TestCase):
|
|||
|
||||
def test_download_attachments(self):
|
||||
real_file = os.path.join(CUR_DIR, 'content/article.rst')
|
||||
good_url = 'file://' + real_file
|
||||
good_url = path_to_file_url(real_file)
|
||||
bad_url = 'http://localhost:1/not_a_file.txt'
|
||||
silent_da = mute()(download_attachments)
|
||||
with temporary_folder() as temp:
|
||||
#locations = download_attachments(temp, [good_url, bad_url])
|
||||
locations = list(silent_da(temp, [good_url, bad_url]))
|
||||
self.assertTrue(len(locations) == 1)
|
||||
self.assertEqual(1, len(locations))
|
||||
directory = locations[0]
|
||||
self.assertTrue(directory.endswith('content/article.rst'))
|
||||
self.assertTrue(directory.endswith(os.path.join('content', 'article.rst')), directory)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue