<s> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> import tempfile <EOL> import shutil <EOL> import os <EOL> import re <EOL> from blogofile import main <EOL> from blogofile import util <EOL> from blogofile import template <EOL> from blogofile import cache <EOL> import logging <EOL> @ unittest . skip ( '<STR_LIT>' ) <EOL> class TestBuild ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> main . do_debug ( ) <EOL> self . previous_dir = os . getcwd ( ) <EOL> self . build_path = tempfile . mkdtemp ( ) <EOL> os . chdir ( self . build_path ) <EOL> main . config . init ( ) <EOL> def tearDown ( self ) : <EOL> main . config . override_options = { } <EOL> os . chdir ( self . previous_dir ) <EOL> shutil . rmtree ( self . build_path ) <EOL> template . MakoTemplate . template_lookup = None <EOL> template . JinjaTemplate . template_lookup = None <EOL> main . config . reset_config ( ) <EOL> cache . reset_bf ( ) <EOL> def testBlogSubDir ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> main . main ( "<STR_LIT>" ) <EOL> lsdir = os . listdir ( os . path . join ( self . build_path , "<STR_LIT>" , <EOL> "<STR_LIT:path>" , "<STR_LIT:to>" , "<STR_LIT>" ) ) <EOL> for fn in ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) : <EOL> assert ( fn in lsdir ) <EOL> def testPermaPages ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> main . main ( "<STR_LIT>" ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> def testNoPosts ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> shutil . rmtree ( "<STR_LIT>" ) <EOL> util . mkdir ( "<STR_LIT>" ) <EOL> main . main ( "<STR_LIT>" ) <EOL> def testPostInSubdir ( self ) : <EOL> "<STR_LIT>" <EOL> pass <EOL> def testNoPostsDir ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> shutil . rmtree ( "<STR_LIT>" ) <EOL> logger = logging . getLogger ( "<STR_LIT>" ) <EOL> logger . setLevel ( logging . CRITICAL ) <EOL> main . main ( "<STR_LIT>" ) <EOL> logger . setLevel ( logging . ERROR ) <EOL> def testCategoryPages ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> main . main ( "<STR_LIT>" ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT:path>" , <EOL> "<STR_LIT:to>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:1>" ) ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT:path>" , <EOL> "<STR_LIT:to>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT:path>" , <EOL> "<STR_LIT:to>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT:path>" , <EOL> "<STR_LIT:to>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:1>" ) ) <EOL> def testArchivePages ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> main . main ( "<STR_LIT>" ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT:path>" , <EOL> "<STR_LIT:to>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:1>" ) ) <EOL> def testFeeds ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> main . main ( "<STR_LIT>" ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT:path>" , "<STR_LIT:to>" , <EOL> "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT:path>" , "<STR_LIT:to>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT:path>" , "<STR_LIT:to>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT:path>" , "<STR_LIT:to>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> def testFileIgnorePatterns ( self ) : <EOL> main . main ( "<STR_LIT>" ) <EOL> main . config . init ( "<STR_LIT>" ) <EOL> open ( "<STR_LIT>" , "<STR_LIT:w>" ) . close ( ) <EOL> open ( "<STR_LIT>" , "<STR_LIT:w>" ) . close ( ) <EOL> main . config . site . file_ignore_patterns . append ( r"<STR_LIT>" ) <EOL> p = re . compile ( "<STR_LIT>" ) <EOL> main . config . site . file_ignore_patterns . append ( p ) <EOL> main . config . recompile ( ) <EOL> main . do_build ( [ ] , load_config = False ) <EOL> assert not "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" ) ) <EOL> assert not "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" ) ) <EOL> def testAutoPermalinks ( self ) : <EOL> main . main ( "<STR_LIT>" ) <EOL> main . main ( "<STR_LIT>" ) <EOL> assert os . path . isfile ( os . path . join ( <EOL> self . build_path , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> def testAutoPermalinkPagesRespectBlogPath ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> main . main ( "<STR_LIT>" ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert "<STR_LIT>" in os . listdir ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) </s>
