6 from cola
import models
8 class GitOpsTest(testlib
.TestCase
):
14 git init 2>&1 > /dev/null
18 model
= models
.Model()
19 model
.git
.commit(m
="commit test")
20 log
= testlib
.pipe("git log --pretty=oneline | wc -l")
22 self
.failUnless('1' == log
)
26 git init 2>&1 >/dev/null
27 git config section.key value
29 model
= models
.Model()
30 value
= model
.git
.config('section.key', get
=True)
32 self
.failUnless(value
== 'value')
35 model
.config_set('section.bool', True)
36 value
= model
.git
.config('section.bool', get
=True)
38 self
.failUnless(value
== 'true')
39 model
.config_set('section.bool', False)
42 config_dict
= model
.config_dict(local
=True)
44 self
.failUnless( config_dict
['section_key'] == 'value' )
45 self
.failUnless( config_dict
['section_bool'] == False )
47 # Test config_dict --global
48 global_dict
= model
.config_dict(local
=False)
50 self
.failUnless(type(global_dict
) is dict)
52 if __name__
== '__main__':