示例#1
0
 def _read_format(self):
     format = self._read_line()
     if format != FORMAT_ONE:
         raise errors.UnknownContainerFormatError(format)
示例#2
0
 def _state_expecting_format_line(self):
     line = self._consume_line()
     if line is not None:
         if line != FORMAT_ONE:
             raise errors.UnknownContainerFormatError(line)
         self._state_handler = self._state_expecting_record_type
示例#3
0
 def test_unknown_container_format(self):
     """Test the formatting of UnknownContainerFormatError."""
     e = errors.UnknownContainerFormatError('bad format string')
     self.assertEqual("Unrecognised container format: 'bad format string'",
                      str(e))