<s> import os <EOL> import sys <EOL> import unittest <EOL> here = os . path . dirname ( __file__ ) <EOL> sys . path . extend ( ( <EOL> os . path . join ( here , os . path . pardir ) , <EOL> os . path . join ( here , '<STR_LIT>' ) <EOL> ) ) <EOL> class SimpleTestCase ( unittest . TestCase ) : <EOL> def test_basic_functionality ( self ) : <EOL> import using_testlib_10 as v1 <EOL> import using_testlib_20 as v2 <EOL> self . assertEqual ( v1 . a_function ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( v2 . a_function ( ) , '<STR_LIT>' ) <EOL> self . assert_ ( '<STR_LIT>' in sys . modules ) <EOL> def test_naming ( self ) : <EOL> import multiversion <EOL> import using_testlib_10 as v1 <EOL> import using_testlib_20 as v2 <EOL> prefix = multiversion . space . __name__ + '<STR_LIT:.>' <EOL> self . assertEqual ( v1 . mod . __name__ , prefix + '<STR_LIT>' ) <EOL> self . assertEqual ( v2 . mod . __name__ , prefix + '<STR_LIT>' ) <EOL> def test_proxy ( self ) : <EOL> import using_testlib_10 as v1 <EOL> import multiversion <EOL> self . assertEqual ( v1 . a_function ( ) , '<STR_LIT>' ) <EOL> import testlib <EOL> try : <EOL> testlib . a_function <EOL> except AttributeError : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> multiversion . require_version ( '<STR_LIT>' , '<STR_LIT:1.0>' , <EOL> globals = globals ( ) ) <EOL> self . assertEqual ( testlib . a_function ( ) , '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
