<s> """<STR_LIT>""" <EOL> from hyde . generator import Generator <EOL> from hyde . model import Config <EOL> from hyde . site import Site <EOL> from fswrap import File , Folder <EOL> import yaml <EOL> TEST_SITE = File ( __file__ ) . parent . parent . child_folder ( '<STR_LIT>' ) <EOL> class TestUrlCleaner ( object ) : <EOL> def setUp ( self ) : <EOL> TEST_SITE . make ( ) <EOL> TEST_SITE . parent . child_folder ( <EOL> '<STR_LIT>' ) . copy_contents_to ( TEST_SITE ) <EOL> def tearDown ( self ) : <EOL> TEST_SITE . delete ( ) <EOL> def test_url_cleaner ( self ) : <EOL> s = Site ( TEST_SITE ) <EOL> cfg = """<STR_LIT>""" <EOL> s . config = Config ( TEST_SITE , config_dict = yaml . load ( cfg ) ) <EOL> text = """<STR_LIT>""" <EOL> about2 = File ( TEST_SITE . child ( '<STR_LIT>' ) ) <EOL> about2 . write ( text ) <EOL> gen = Generator ( s ) <EOL> gen . generate_all ( ) <EOL> from pyquery import PyQuery <EOL> target = File ( Folder ( s . config . deploy_root_path ) . child ( '<STR_LIT>' ) ) <EOL> text = target . read_all ( ) <EOL> q = PyQuery ( text ) <EOL> assert q ( '<STR_LIT>' ) . attr ( "<STR_LIT>" ) == '<STR_LIT:/>' <EOL> assert q ( '<STR_LIT>' ) . attr ( <EOL> "<STR_LIT>" ) == '<STR_LIT>' </s>
