<s> """<STR_LIT>""" <EOL> import os <EOL> import shutil <EOL> import tempfile <EOL> import unittest <EOL> from os . path import dirname , join , isdir , isfile , exists <EOL> from cvsgit . git import Git <EOL> from cvsgit . utils import Tempdir <EOL> class Test ( unittest . TestCase ) : <EOL> def test_init_working_directory ( self ) : <EOL> """<STR_LIT>""" <EOL> with Tempdir ( cwd = True ) as tempdir : <EOL> git = Git ( ) <EOL> self . assertEquals ( tempdir , git . git_work_tree ) <EOL> self . assertEquals ( join ( tempdir , '<STR_LIT>' ) , git . git_dir ) <EOL> git . init ( quiet = True ) <EOL> self . assertEquals ( tempdir , git . git_work_tree ) <EOL> self . assertEquals ( join ( tempdir , '<STR_LIT>' ) , git . git_dir ) <EOL> self . assertTrue ( isdir ( join ( tempdir , '<STR_LIT>' ) ) ) <EOL> git . destroy ( ) <EOL> self . assertFalse ( isdir ( tempdir ) ) <EOL> def test_init_bare_working_directory ( self ) : <EOL> """<STR_LIT>""" <EOL> with Tempdir ( cwd = True ) as tempdir : <EOL> git = Git ( ) <EOL> self . assertEquals ( tempdir , git . git_work_tree ) <EOL> self . assertEquals ( join ( tempdir , '<STR_LIT>' ) , git . git_dir ) <EOL> git . init ( bare = True , quiet = True ) <EOL> self . assertEquals ( None , git . git_work_tree ) <EOL> self . assertEquals ( tempdir , git . git_dir ) <EOL> self . assertFalse ( isdir ( join ( tempdir , '<STR_LIT>' ) ) ) <EOL> self . assertTrue ( isfile ( join ( tempdir , '<STR_LIT>' ) ) ) <EOL> self . assertTrue ( isdir ( join ( tempdir , '<STR_LIT>' ) ) ) <EOL> git . destroy ( ) <EOL> self . assertFalse ( isdir ( tempdir ) ) <EOL> def test_init_specified_directory ( self ) : <EOL> """<STR_LIT>""" <EOL> with Tempdir ( cwd = True ) as tempdir : <EOL> directory = join ( tempdir , '<STR_LIT>' ) <EOL> git = Git ( directory ) <EOL> git . init ( quiet = True ) <EOL> self . assertEquals ( directory , git . git_work_tree ) <EOL> self . assertEquals ( join ( directory , '<STR_LIT>' ) , git . git_dir ) <EOL> self . assertTrue ( isdir ( join ( directory , '<STR_LIT>' ) ) ) <EOL> git . destroy ( ) <EOL> self . assertFalse ( isdir ( directory ) ) <EOL> self . assertTrue ( isdir ( tempdir ) ) <EOL> def test_config_set_and_get ( self ) : <EOL> """<STR_LIT>""" <EOL> with Tempdir ( cwd = True ) as tempdir : <EOL> git = Git ( ) <EOL> self . assertEquals ( None , git . config_get ( '<STR_LIT>' ) ) <EOL> git . init ( quiet = True ) <EOL> git . config_set ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEquals ( '<STR_LIT>' , git . config_get ( '<STR_LIT>' ) ) </s>
