~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Martin Pool
  • Date: 2006-02-22 04:29:54 UTC
  • mfrom: (1566 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1569.
  • Revision ID: mbp@sourcefrog.net-20060222042954-60333f08dd56a646
[merge] from bzr.dev before integration
Fix undefined ordering in sign_my_revisions breaking tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
                      "email=Robert Collins <robertc@example.com>\n"
33
33
                      "editor=vim\n"
34
34
                      "gpg_signing_command=gnome-gpg\n"
 
35
                      "log_format=short\n"
35
36
                      "user_global_option=something\n")
36
37
 
37
38
 
128
129
        return self._signatures
129
130
 
130
131
 
 
132
bool_config = """[DEFAULT]
 
133
active = true
 
134
inactive = false
 
135
[UPPERCASE]
 
136
active = True
 
137
nonactive = False
 
138
"""
 
139
class TestConfigObj(TestCase):
 
140
    def test_get_bool(self):
 
141
        from bzrlib.config import ConfigObj
 
142
        co = ConfigObj(StringIO(bool_config))
 
143
        self.assertIs(co.get_bool('DEFAULT', 'active'), True)
 
144
        self.assertIs(co.get_bool('DEFAULT', 'inactive'), False)
 
145
        self.assertIs(co.get_bool('UPPERCASE', 'active'), True)
 
146
        self.assertIs(co.get_bool('UPPERCASE', 'nonactive'), False)
 
147
 
 
148
 
131
149
class TestConfig(TestCase):
132
150
 
133
151
    def test_constructs(self):
176
194
        my_config = config.Config()
177
195
        self.assertEqual(None, my_config.post_commit())
178
196
 
 
197
    def test_log_format_default(self):
 
198
        my_config = config.Config()
 
199
        self.assertEqual('long', my_config.log_format())
 
200
 
179
201
 
180
202
class TestConfigPath(TestCase):
181
203
 
352
374
        my_config = self._get_sample_config()
353
375
        self.assertEqual(None, my_config.post_commit())
354
376
 
 
377
    def test_configured_logformat(self):
 
378
        my_config = self._get_sample_config()
 
379
        self.assertEqual("short", my_config.log_format())
 
380
 
355
381
 
356
382
class TestLocationConfig(TestCase):
357
383