<s> import os <EOL> TESTNAME = "<STR_LIT>" <EOL> FILENAME = "<STR_LIT>" % TESTNAME <EOL> with repository . workcopy ( ) as work : <EOL> upstream_sha1 = work . run ( [ "<STR_LIT>" , "<STR_LIT>" ] ) . strip ( ) <EOL> work . run ( [ "<STR_LIT>" , "<STR_LIT>" % TESTNAME ] ) <EOL> work . run ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" % TESTNAME ] ) <EOL> with open ( os . path . join ( work . path , FILENAME ) , "<STR_LIT:w>" ) as text_file : <EOL> print >> text_file , "<STR_LIT>" <EOL> work . run ( [ "<STR_LIT>" , FILENAME ] ) <EOL> work . run ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" % FILENAME ] , <EOL> GIT_AUTHOR_NAME = "<STR_LIT>" , <EOL> GIT_AUTHOR_EMAIL = "<STR_LIT>" , <EOL> GIT_COMMITTER_NAME = "<STR_LIT>" , <EOL> GIT_COMMITTER_EMAIL = "<STR_LIT>" ) <EOL> head_sha1 = work . run ( [ "<STR_LIT>" , "<STR_LIT>" ] ) . strip ( ) <EOL> work . run ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" % TESTNAME ] ) <EOL> work . run ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" % TESTNAME ] ) <EOL> with frontend . signin ( "<STR_LIT>" ) : <EOL> result = frontend . operation ( <EOL> "<STR_LIT>" , <EOL> data = { "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : repository . url , <EOL> "<STR_LIT>" : "<STR_LIT>" % TESTNAME , <EOL> "<STR_LIT>" : "<STR_LIT>" % TESTNAME } , <EOL> expect = { "<STR_LIT>" : head_sha1 , <EOL> "<STR_LIT>" : upstream_sha1 } ) <EOL> commit_ids = result [ "<STR_LIT>" ] <EOL> def check_commit_ids ( value ) : <EOL> if set ( value ) != set ( commit_ids ) : <EOL> return repr ( sorted ( value ) ) , repr ( sorted ( commit_ids ) ) <EOL> frontend . operation ( <EOL> "<STR_LIT>" , <EOL> data = { "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : repository . url , <EOL> "<STR_LIT>" : "<STR_LIT>" % TESTNAME , <EOL> "<STR_LIT>" : "<STR_LIT>" % TESTNAME } , <EOL> expect = { "<STR_LIT>" : head_sha1 , <EOL> "<STR_LIT>" : upstream_sha1 , <EOL> "<STR_LIT>" : check_commit_ids } ) </s>
