6 from testutils
import pipe
10 class GitOpsTest(testutils
.TestCase
):
15 git init 2>&1 >/dev/null
18 git
.commit(m
="commit test")
19 log
= pipe("git log --pretty=oneline | wc -l")
21 self
.failUnless( '1' == log
)
25 git init 2>&1 >/dev/null
26 git config section.key value
28 value
= git
.config('section.key', get
=True)
30 self
.failUnless( value
== 'value' )
33 git
.config_set('section.bool', True)
34 value
= git
.config('section.bool', get
=True)
36 self
.failUnless( value
== 'true' )
37 git
.config_set('section.bool', False)
40 config_dict
= git
.config_dict(local
=True)
42 self
.failUnless( config_dict
['section_key'] == 'value' )
43 self
.failUnless( config_dict
['section_bool'] == False )
45 # Test config_dict --global
46 global_dict
= git
.config_dict(local
=False)
48 self
.failUnless( type(global_dict
) is dict )
50 if __name__
== '__main__':