<s> from __future__ import absolute_import , division <EOL> import os <EOL> from mock import Mock <EOL> from twisted . trial import unittest <EOL> from twisted . python . compat import unicode <EOL> import setup <EOL> class SetupTestCase ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_read ( self ) : <EOL> """<STR_LIT>""" <EOL> contents = '<STR_LIT:foo>' <EOL> path = os . path . abspath ( self . mktemp ( ) ) <EOL> with open ( path , '<STR_LIT>' ) as f : <EOL> f . write ( contents ) <EOL> rv = setup . read ( path ) <EOL> self . assertEqual ( contents , rv ) <EOL> self . assertIsInstance ( rv , unicode ) <EOL> def test_findVersion ( self ) : <EOL> """<STR_LIT>""" <EOL> self . patch ( setup , '<STR_LIT>' , Mock ( return_value = '''<STR_LIT>''' ) ) <EOL> self . assertEqual ( <EOL> u"<STR_LIT>" , <EOL> setup . find_version ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> ) </s>
