~ubuntu-branches/ubuntu/trusty/freeipa/trusty

« back to all changes in this revision

Viewing changes to tests/test_ipalib/test_errors.py

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2013-03-07 14:10:03 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130307141003-kz4lq9vj4x692mqq
Tags: 3.1.2-0ubuntu1
* Merge from unreleased debian git.
  - new upstream release
  - doesn't use chkconfig anymore (LP: #1025018, #1124093)
  - drop -U from the ntpdate options (LP: #1149468)

Show diffs side-by-side

added added

removed removed

Lines of Context:
318
318
        assert inst.text is kw['text']
319
319
        assert inst.number is kw['number']
320
320
 
 
321
        # Test with instructions:
 
322
        # first build up "instructions", then get error and search for
 
323
        # lines of instructions appended to the end of the strerror
 
324
        # despite the parameter 'instructions' not existing in the format
 
325
        instructions = u"The quick brown fox jumps over the lazy dog".split()
 
326
        # this expression checks if each word of instructions
 
327
        # exists in a string as a separate line, with right order
 
328
        regexp = re.compile('(?ims).*' +
 
329
                            ''.join(map(lambda x: '(%s).*' % (x),
 
330
                                        instructions)) +
 
331
                            '$')
 
332
        inst = subclass(instructions=instructions, **kw)
 
333
        assert inst.format is subclass.format
 
334
        assert_equal(inst.instructions, instructions)
 
335
        inst_match = regexp.match(inst.strerror).groups()
 
336
        assert_equal(list(inst_match),list(instructions))
 
337
 
321
338
 
322
339
def test_public_errors():
323
340
    """