<s> from UnitTest import UnitTest <EOL> import RunTests <EOL> import os <EOL> import sys <EOL> sys . path [ <NUM_LIT:0> : <NUM_LIT:0> ] = [ os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ) ) ) ] <EOL> import pyjspath <EOL> from pyjspath import realpath , abspath , dirname , basename <EOL> class PyjsPathTest ( UnitTest ) : <EOL> def test_commonprefix ( self ) : <EOL> commonprefix = pyjspath . commonprefix <EOL> self . assertEqual ( <EOL> commonprefix ( [ ] ) , <EOL> "<STR_LIT>" <EOL> ) <EOL> self . assertEqual ( <EOL> commonprefix ( [ "<STR_LIT>" , "<STR_LIT>" ] ) , <EOL> "<STR_LIT>" <EOL> ) <EOL> self . assertEqual ( <EOL> commonprefix ( [ "<STR_LIT>" , "<STR_LIT>" ] ) , <EOL> "<STR_LIT>" <EOL> ) <EOL> self . assertEqual ( <EOL> commonprefix ( [ "<STR_LIT>" , "<STR_LIT>" ] ) , <EOL> "<STR_LIT>" <EOL> ) <EOL> self . assertEqual ( <EOL> commonprefix ( [ "<STR_LIT>" , "<STR_LIT>" ] ) , <EOL> "<STR_LIT>" <EOL> ) <EOL> def test_join ( self ) : <EOL> self . assertEqual ( pyjspath . join ( "<STR_LIT>" , "<STR_LIT:bar>" , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> self . assertEqual ( pyjspath . join ( "<STR_LIT>" , "<STR_LIT:bar>" , "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> self . assertEqual ( pyjspath . join ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> def test_split ( self ) : <EOL> self . assertEqual ( pyjspath . split ( "<STR_LIT>" ) , ( "<STR_LIT>" , "<STR_LIT:bar>" ) ) <EOL> self . assertEqual ( pyjspath . split ( "<STR_LIT:/>" ) , ( "<STR_LIT:/>" , "<STR_LIT>" ) ) <EOL> self . assertEqual ( pyjspath . split ( "<STR_LIT:foo>" ) , ( "<STR_LIT>" , "<STR_LIT:foo>" ) ) <EOL> self . assertEqual ( pyjspath . split ( "<STR_LIT>" ) , ( "<STR_LIT>" , "<STR_LIT:foo>" ) ) <EOL> self . assertEqual ( pyjspath . split ( "<STR_LIT>" ) , ( "<STR_LIT>" , "<STR_LIT:bar>" ) ) <EOL> def splitextTest ( self , path , filename , ext ) : <EOL> self . assertEqual ( pyjspath . splitext ( path ) , ( filename , ext ) ) <EOL> self . assertEqual ( pyjspath . splitext ( "<STR_LIT:/>" + path ) , ( "<STR_LIT:/>" + filename , ext ) ) <EOL> self . assertEqual ( pyjspath . splitext ( "<STR_LIT>" + path ) , ( "<STR_LIT>" + filename , ext ) ) <EOL> self . assertEqual ( pyjspath . splitext ( "<STR_LIT>" + path ) , ( "<STR_LIT>" + filename , ext ) ) <EOL> self . assertEqual ( pyjspath . splitext ( "<STR_LIT>" + path ) , ( "<STR_LIT>" + filename , ext ) ) <EOL> self . assertEqual ( pyjspath . splitext ( path + "<STR_LIT:/>" ) , ( filename + ext + "<STR_LIT:/>" , "<STR_LIT>" ) ) <EOL> def test_splitext ( self ) : <EOL> self . splitextTest ( "<STR_LIT>" , "<STR_LIT:foo>" , "<STR_LIT>" ) <EOL> self . splitextTest ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . splitextTest ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . splitextTest ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . splitextTest ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . splitextTest ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . splitextTest ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . splitextTest ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . splitextTest ( "<STR_LIT:.>" , "<STR_LIT:.>" , "<STR_LIT>" ) <EOL> self . splitextTest ( "<STR_LIT:..>" , "<STR_LIT:..>" , "<STR_LIT>" ) <EOL> self . splitextTest ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . splitextTest ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> def test_isabs ( self ) : <EOL> self . assertEqual ( pyjspath . isabs ( "<STR_LIT>" ) , False ) <EOL> self . assertEqual ( pyjspath . isabs ( "<STR_LIT:/>" ) , True ) <EOL> self . assertEqual ( pyjspath . isabs ( "<STR_LIT>" ) , True ) <EOL> self . assertEqual ( pyjspath . isabs ( "<STR_LIT>" ) , True ) <EOL> self . assertEqual ( pyjspath . isabs ( "<STR_LIT>" ) , False ) <EOL> def test_basename ( self ) : <EOL> self . assertEqual ( pyjspath . basename ( "<STR_LIT>" ) , "<STR_LIT:bar>" ) <EOL> self . assertEqual ( pyjspath . basename ( "<STR_LIT:/>" ) , "<STR_LIT>" ) <EOL> self . assertEqual ( pyjspath . basename ( "<STR_LIT:foo>" ) , "<STR_LIT:foo>" ) <EOL> self . assertEqual ( pyjspath . basename ( "<STR_LIT>" ) , "<STR_LIT:foo>" ) <EOL> self . assertEqual ( pyjspath . basename ( "<STR_LIT>" ) , "<STR_LIT:bar>" ) <EOL> def test_dirname ( self ) : <EOL> self . assertEqual ( pyjspath . dirname ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> self . assertEqual ( pyjspath . dirname ( "<STR_LIT:/>" ) , "<STR_LIT:/>" ) <EOL> self . assertEqual ( pyjspath . dirname ( "<STR_LIT:foo>" ) , "<STR_LIT>" ) <EOL> self . assertEqual ( pyjspath . dirname ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> self . assertEqual ( pyjspath . dirname ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> def test_normpath ( self ) : <EOL> self . assertEqual ( pyjspath . normpath ( "<STR_LIT>" ) , "<STR_LIT:.>" ) <EOL> self . assertEqual ( pyjspath . normpath ( "<STR_LIT:/>" ) , "<STR_LIT:/>" ) <EOL> self . assertEqual ( pyjspath . normpath ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> self . assertEqual ( pyjspath . normpath ( "<STR_LIT>" ) , "<STR_LIT:/>" ) <EOL> self . assertEqual ( pyjspath . normpath ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> self . assertEqual ( pyjspath . normpath ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> self . assertEqual ( pyjspath . normpath ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> def test_main ( ) : <EOL> t = RunTests . RunTests ( ) <EOL> t . add ( PyjsPathTest ) <EOL> t . start_test ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> test_main ( ) </s>
