<s> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> import tempfile <EOL> import shutil <EOL> import os <EOL> from blogofile import main <EOL> @ unittest . skip ( '<STR_LIT>' ) <EOL> class TestContent ( unittest . TestCase ) : <EOL> def setUp ( self ) : <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> def testAutoPermalink ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> src = """<STR_LIT>""" <EOL> f = open ( <EOL> os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:w>" ) <EOL> f . write ( src ) <EOL> f . close ( ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : True , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> main . main ( "<STR_LIT>" ) <EOL> rendered = open ( os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" <EOL> ) ) . read ( ) <EOL> def testHardCodedPermalinkUpperCase ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> permalink = "<STR_LIT>" <EOL> src = """<STR_LIT>""" % { '<STR_LIT>' : permalink } <EOL> f = open ( os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:w>" ) <EOL> f . write ( src ) <EOL> f . close ( ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : True , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> main . main ( "<STR_LIT>" ) <EOL> rendered = open ( os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" <EOL> ) ) . read ( ) <EOL> def testUpperCaseAutoPermalink ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> src = """<STR_LIT>""" <EOL> f = open ( os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:w>" ) <EOL> f . write ( src ) <EOL> f . close ( ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : True , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> main . main ( "<STR_LIT>" ) <EOL> rendered = open ( os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" <EOL> ) ) . read ( ) <EOL> def testPathOnlyPermalink ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> permalink = "<STR_LIT>" <EOL> src = """<STR_LIT>""" % { '<STR_LIT>' : permalink } <EOL> f = open ( os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:w>" ) <EOL> f . write ( src ) <EOL> f . close ( ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : True , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> main . main ( "<STR_LIT>" ) <EOL> rendered = open ( os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" <EOL> ) ) . read ( ) <EOL> def testReStructuredFilter ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> src = """<STR_LIT>""" <EOL> f = open ( os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:w>" ) <EOL> f . write ( src ) <EOL> f . close ( ) <EOL> main . config . override_options = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : True , <EOL> "<STR_LIT>" : "<STR_LIT>" } <EOL> main . main ( "<STR_LIT>" ) <EOL> rendered = open ( os . path . join ( self . build_path , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" <EOL> ) ) . read ( ) <EOL> assert """<STR_LIT>""" in rendered <EOL> def testUnpublishedPost ( self ) : <EOL> """<STR_LIT>""" <EOL> main . main ( "<STR_LIT>" ) <EOL> main . main ( "<STR_LIT>" ) <EOL> rendered = open ( os . path . join ( <EOL> self . build_path , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" <EOL> ) ) . read ( ) <EOL> assert not os . path . exists ( os . path . join ( <EOL> self . build_path , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" ) ) <EOL> assert not os . path . exists ( os . path . join ( <EOL> self . build_path , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" ) ) </s>
