#NEWLINE# def test_stale_module_check( self ) : #NEWLINE# #INDENT# test_settings = copy . deepcopy ( Settings ) #NEWLINE# repo_path = tempfile . mkdtemp ( prefix = 'pushmanager' ) #NEWLINE# submodule_path = tempfile . mkdtemp ( prefix = 'pushmanager' ) #NEWLINE# self . temp_git_dirs . append ( repo_path ) #NEWLINE# self . temp_git_dirs . append ( submodule_path ) #NEWLINE# test_settings [ 'git' ] [ 'local_repo_path' ] = repo_path #NEWLINE# GitCommand ( 'init' , repo_path , cwd = repo_path ) . run ( ) #NEWLINE# GitCommand ( 'config' , 'user.email' , 'test@pushmanager' , cwd = repo_path ) . run ( ) #NEWLINE# GitCommand ( 'config' , 'user.name' , 'pushmanager tester' , cwd = repo_path ) . run ( ) #NEWLINE# with open ( os . path . join ( f , 'code.py' ) , 'w' ) as f : #NEWLINE# #INDENT# f . write ( '#!/usr/bin/env python\n\nprint("Hello World!")\nPrint("Goodbye!")\n' ) #NEWLINE# #UNINDENT# GitCommand ( 'add' , repo_path , cwd = repo_path ) . run ( ) #NEWLINE# GitCommand ( 'commit' , '-a' , '-m' , 'Master Commit' , cwd = repo_path ) . run ( ) #NEWLINE# GitCommand ( 'init' , submodule_path , cwd = submodule_path ) . run ( ) #NEWLINE# GitCommand ( 'config' , 'user.email' , 'test@pushmanager' , cwd = submodule_path ) . run ( ) #NEWLINE# GitCommand ( 'config' , 'user.name' , 'pushmanager tester' , cwd = submodule_path ) . run ( ) #NEWLINE# with open ( os . path . join ( submodule_path , 'codemodule.py' ) , 'w' ) as f : #NEWLINE# #INDENT# f . write ( '#!/usr/bin/env python\n\nprint("Hello World!")\nPrint("Goodbye!")\n' ) #NEWLINE# #UNINDENT# GitCommand ( 'add' , submodule_path , cwd = submodule_path ) . run ( ) #NEWLINE# GitCommand ( 'commit' , '-a' , '-m' , 'Master Commit' , cwd = submodule_path ) . run ( ) #NEWLINE# GitCommand ( 'checkout' , '-b' , 'change_german' , cwd = submodule_path ) . run ( ) #NEWLINE# with open ( os . path . join ( submodule_path , 'codemodule.py' ) , 'w' ) as f : #NEWLINE# #INDENT# f . write ( '#!/usr/bin/env python\n\nprint("Hallo Welt!")\nPrint("Goodbye!")\n' ) #NEWLINE# #UNINDENT# GitCommand ( 'commit' , '-a' , '-m' , 'verpflichten' , cwd = submodule_path ) . run ( ) #NEWLINE# GitCommand ( 'checkout' , 'master' , cwd = submodule_path ) . run ( ) #NEWLINE# GitCommand ( 'checkout' , '-b' , 'change_welsh' , cwd = submodule_path ) . run ( ) #NEWLINE# with open ( os . path . join ( submodule_path , 'codemodule.py' ) , 'w' ) as f : #NEWLINE# #INDENT# f . write ( '#!/usr/bin/env python\n\nprint("Helo Byd!")\nPrint("Goodbye!")\n' ) #NEWLINE# #UNINDENT# GitCommand ( 'commit' , '-a' , '-m' , 'ymrwymo' , cwd = submodule_path ) . run ( ) #NEWLINE# GitCommand ( 'checkout' , 'master' , cwd = submodule_path ) . run ( ) #NEWLINE# GitCommand ( 'submodule' , 'add' , submodule_path , cwd = repo_path ) . run ( ) #NEWLINE# GitCommand ( 'commit' , '-a' , '-m' , 'Add submodule' , cwd = repo_path ) . run ( ) #NEWLINE# internal_submodule_path = os . path . join ( repo_path , submodule_path . split ( '/' ) [ ( - 1 ) : ] [ 0 ] ) #NEWLINE# GitCommand ( 'checkout' , '-b' , 'change_german' , cwd = repo_path ) . run ( ) #NEWLINE# GitCommand ( 'checkout' , 'change_german' , cwd = internal_submodule_path ) . run ( ) #NEWLINE# GitCommand ( 'commit' , '-a' , '-m' , 'verpflichten' , cwd = repo_path ) . run ( ) #NEWLINE# GitCommand ( 'checkout' , 'master' , cwd = repo_path ) . run ( ) #NEWLINE# GitCommand ( 'checkout' , '-b' , 'change_welsh' , cwd = repo_path ) . run ( ) #NEWLINE# GitCommand ( 'commit' , '-a' , '-m' , 'ymrwymo' , cwd = repo_path ) . run ( ) #NEWLINE# GitCommand ( 'checkout' , 'change_welsh' , cwd = internal_submodule_path ) . run ( ) #NEWLINE# GitCommand ( 'checkout' , 'master' , cwd = repo_path ) . run ( ) #NEWLINE# T . assert_raises ( GitException , pushmanager . core . git . _stale_submodule_check , repo_path )