<s> from __future__ import ( absolute_import , division , generators , nested_scopes , print_function , <EOL> unicode_literals , with_statement ) <EOL> import os <EOL> from pants . util . dirutil import safe_mkdir_for <EOL> class ReproMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> def add_file ( self , root , path , content ) : <EOL> """<STR_LIT>""" <EOL> fullpath = os . path . join ( root , path ) <EOL> safe_mkdir_for ( fullpath ) <EOL> with open ( fullpath , '<STR_LIT:w>' ) as outfile : <EOL> outfile . write ( content ) <EOL> def assert_not_exists ( self , root , path ) : <EOL> """<STR_LIT>""" <EOL> fullpath = os . path . join ( root , path ) <EOL> self . assertFalse ( os . path . exists ( fullpath ) ) <EOL> def assert_file ( self , root , path , expected_content = None ) : <EOL> """<STR_LIT>""" <EOL> fullpath = os . path . join ( root , path ) <EOL> self . assertTrue ( os . path . isfile ( fullpath ) ) <EOL> if expected_content : <EOL> with open ( fullpath , '<STR_LIT:r>' ) as infile : <EOL> content = infile . read ( ) <EOL> self . assertEqual ( expected_content , content ) </s>
