<s> import os . path <EOL> from mrjob . fs . base import Filesystem <EOL> from tests . py2 import TestCase <EOL> from tests . py2 import patch <EOL> from tests . quiet import no_handlers_for_logger <EOL> from tests . sandbox import SandboxedTestCase <EOL> class JoinTestCase ( SandboxedTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( JoinTestCase , self ) . setUp ( ) <EOL> self . fs = Filesystem ( ) <EOL> def test_local_paths ( self ) : <EOL> self . assertEqual ( self . fs . join ( '<STR_LIT:foo>' , '<STR_LIT:bar>' ) , <EOL> '<STR_LIT>' % os . path . sep ) <EOL> self . assertEqual ( self . fs . join ( '<STR_LIT:foo>' , '<STR_LIT>' % os . path . sep ) , <EOL> '<STR_LIT>' % os . path . sep ) <EOL> self . assertEqual ( self . fs . join ( '<STR_LIT:foo>' , '<STR_LIT:bar>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' % ( os . path . sep , os . path . sep ) ) <EOL> def test_path_onto_uri ( self ) : <EOL> self . assertEqual ( self . fs . join ( '<STR_LIT>' , '<STR_LIT:path>' ) , <EOL> '<STR_LIT>' ) <EOL> def test_uri_onto_anything ( self ) : <EOL> self . assertEqual ( self . fs . join ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' ) <EOL> self . assertEqual ( self . fs . join ( '<STR_LIT:/>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' ) <EOL> self . assertEqual ( self . fs . join ( '<STR_LIT:/>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' ) <EOL> class DeprecatedAliasesTestCase ( TestCase ) : <EOL> def test_path_exists ( self ) : <EOL> fs = Filesystem ( ) <EOL> with patch . object ( fs , '<STR_LIT>' ) : <EOL> with no_handlers_for_logger ( '<STR_LIT>' ) : <EOL> fs . path_exists ( '<STR_LIT:foo>' ) <EOL> fs . exists . assert_called_once_with ( '<STR_LIT:foo>' ) <EOL> def test_path_join ( self ) : <EOL> fs = Filesystem ( ) <EOL> with patch . object ( fs , '<STR_LIT>' ) : <EOL> with no_handlers_for_logger ( '<STR_LIT>' ) : <EOL> fs . path_join ( '<STR_LIT:foo>' , '<STR_LIT:bar>' ) <EOL> fs . join . assert_called_once_with ( '<STR_LIT:foo>' , '<STR_LIT:bar>' ) </s>
