<s> import os <EOL> import uuid <EOL> from tests . integrations . base import BaseTest , gitfs_log <EOL> class TestRepository ( BaseTest ) : <EOL> def test_chmod ( self , gitfs_log ) : <EOL> file_name = "<STR_LIT>" + str ( uuid . uuid4 ( ) ) <EOL> self . sh . touch ( file_name ) <EOL> self . sh . git . add ( file_name ) <EOL> self . sh . git . commit ( "<STR_LIT>" , '<STR_LIT>' ) <EOL> with gitfs_log ( [ "<STR_LIT>" , "<STR_LIT>" ] ) : <EOL> self . sh . git . push ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . sh . chmod ( "<STR_LIT>" , file_name ) <EOL> self . sh . git . add ( file_name ) <EOL> self . sh . git . commit ( "<STR_LIT>" , '<STR_LIT>' ) <EOL> with gitfs_log ( [ "<STR_LIT>" , "<STR_LIT>" ] ) : <EOL> self . sh . git . push ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> assert os . path . exists ( "<STR_LIT>" . format ( <EOL> self . mount_path , <EOL> self . get_commit_dates ( ) [ <NUM_LIT:0> ] , <EOL> self . get_commits_by_date ( ) [ <NUM_LIT:0> ] <EOL> ) ) <EOL> assert oct ( <EOL> os . stat ( self . current_path + "<STR_LIT:/>" + file_name ) . st_mode & <NUM_LIT> <EOL> ) == oct ( <NUM_LIT> ) <EOL> def test_new_file ( self , gitfs_log ) : <EOL> file_name = "<STR_LIT>" + str ( uuid . uuid4 ( ) ) <EOL> self . sh . touch ( file_name ) <EOL> self . sh . git . add ( file_name ) <EOL> self . sh . git . commit ( "<STR_LIT>" , '<STR_LIT>' ) <EOL> with gitfs_log ( [ "<STR_LIT>" , "<STR_LIT>" ] ) : <EOL> self . sh . git . push ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> assert os . path . exists ( self . current_path + "<STR_LIT:/>" + file_name ) <EOL> assert os . path . exists ( "<STR_LIT>" % ( <EOL> self . mount_path , <EOL> self . get_commit_dates ( ) [ <NUM_LIT:0> ] , <EOL> self . get_commits_by_date ( ) [ <NUM_LIT:0> ] <EOL> ) ) <EOL> def test_edit_file ( self , gitfs_log ) : <EOL> file_name = "<STR_LIT>" + str ( uuid . uuid4 ( ) ) <EOL> content = "<STR_LIT>" <EOL> self . sh . touch ( file_name ) <EOL> self . sh . git . add ( file_name ) <EOL> self . sh . git . commit ( "<STR_LIT>" , '<STR_LIT>' ) <EOL> self . sh . git . push ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> with open ( os . path . join ( self . remote_repo_path , file_name ) , "<STR_LIT:w>" ) as f : <EOL> f . write ( content ) <EOL> self . sh . git . add ( file_name ) <EOL> self . sh . git . commit ( "<STR_LIT>" , '<STR_LIT>' ) <EOL> with gitfs_log ( [ "<STR_LIT>" , "<STR_LIT>" ] ) : <EOL> self . sh . git . push ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> with open ( self . repo_path + "<STR_LIT:/>" + file_name ) as f : <EOL> assert f . read ( ) == content <EOL> assert os . path . exists ( self . current_path + "<STR_LIT:/>" + file_name ) <EOL> assert os . path . exists ( "<STR_LIT>" % ( <EOL> self . mount_path , <EOL> self . get_commit_dates ( ) [ <NUM_LIT:0> ] , <EOL> self . get_commits_by_date ( ) [ <NUM_LIT:0> ] <EOL> ) ) <EOL> def test_delete_content ( self ) : <EOL> file_name = "<STR_LIT>" + str ( uuid . uuid4 ( ) ) <EOL> with open ( self . repo_path + "<STR_LIT:/>" + file_name , "<STR_LIT:w>" ) as f : <EOL> f . write ( "<STR_LIT>" ) <EOL> self . sh . git . add ( file_name ) <EOL> self . sh . git . commit ( "<STR_LIT>" , '<STR_LIT>' ) <EOL> self . sh . git . push ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> with open ( self . repo_path + "<STR_LIT:/>" + file_name , "<STR_LIT:w>" ) as f : <EOL> pass <EOL> with open ( self . repo_path + "<STR_LIT:/>" + file_name ) as f : <EOL> assert f . read ( ) == "<STR_LIT>" <EOL> assert os . path . exists ( self . current_path + "<STR_LIT:/>" + file_name ) <EOL> assert os . path . exists ( "<STR_LIT>" % ( <EOL> self . mount_path , <EOL> self . get_commit_dates ( ) [ <NUM_LIT:0> ] , <EOL> self . get_commits_by_date ( ) [ <NUM_LIT:0> ] <EOL> ) ) <EOL> def test_delete_file ( self , gitfs_log ) : <EOL> file_name = "<STR_LIT>" + str ( uuid . uuid4 ( ) ) <EOL> self . sh . touch ( file_name ) <EOL> self . sh . git . add ( file_name ) <EOL> self . sh . git . commit ( "<STR_LIT>" , '<STR_LIT>' ) <EOL> with gitfs_log ( [ "<STR_LIT>" , "<STR_LIT>" ] ) : <EOL> self . sh . git . push ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . sh . rm ( file_name ) <EOL> self . sh . git . rm ( file_name ) <EOL> self . sh . git . commit ( "<STR_LIT>" , '<STR_LIT>' ) <EOL> with gitfs_log ( [ "<STR_LIT>" , "<STR_LIT>" ] ) : <EOL> self . sh . git . push ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> assert not os . path . exists ( self . current_path + "<STR_LIT:/>" + file_name ) <EOL> assert os . path . exists ( "<STR_LIT>" % ( <EOL> self . mount_path , <EOL> self . get_commit_dates ( ) [ <NUM_LIT:0> ] , <EOL> self . get_commits_by_date ( ) [ <NUM_LIT:0> ] <EOL> ) ) </s>
