~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-10-10 08:52:29 UTC
  • mfrom: (2903.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20071010085229-7x5al1tirr29mq0l
Fix 149019 by using a proper line number when reporting errors

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
        self.assertIs(co.get_bool('UPPERCASE', 'nonactive'), False)
212
212
 
213
213
 
 
214
erroneous_config = """[section] # line 1
 
215
good=good # line 2
 
216
[section] # line 3
 
217
whocares=notme # line 4
 
218
"""
 
219
class TestConfigObjErrors(TestCase):
 
220
 
 
221
    def test_duplicate_section_name_error_line(self):
 
222
        try:
 
223
            co = ConfigObj(StringIO(erroneous_config), raise_errors=True)
 
224
        except config.configobj.DuplicateError, e:
 
225
            self.assertEqual(3, e.line_number)
 
226
        else:
 
227
            self.fail('Error in config file not detected')
 
228
 
214
229
class TestConfig(TestCase):
215
230
 
216
231
    def test_constructs(self):