6 from testutils
import pipe
8 from ugit
import models
10 class GitOpsTest(testutils
.TestCase
):
16 git init 2>&1 > /dev/null
20 model
= models
.Model()
21 model
.commit(m
="commit test")
22 log
= pipe("git log --pretty=oneline | wc -l")
24 self
.failUnless( '1' == log
)
28 git init 2>&1 >/dev/null
29 git config section.key value
31 model
= models
.Model()
32 value
= model
.config('section.key', get
=True)
34 self
.failUnless( value
== 'value' )
37 model
.config_set('section.bool', True)
38 value
= model
.config('section.bool', get
=True)
40 self
.failUnless( value
== 'true' )
41 model
.config_set('section.bool', False)
44 config_dict
= model
.config_dict(local
=True)
46 self
.failUnless( config_dict
['section_key'] == 'value' )
47 self
.failUnless( config_dict
['section_bool'] == False )
49 # Test config_dict --global
50 global_dict
= model
.config_dict(local
=False)
52 self
.failUnless( type(global_dict
) is dict )
54 if __name__
== '__main__':