def test_status_with_file_bad_encoder_fails(self):
node = factory.make_Node(
interface=True, status=NODE_STATUS.COMMISSIONING)
contents = b'These are the contents of the file.'
encoded_content = encode_as_base64(bz2.compress(contents))
payload = {
'event_type': 'finish',
'result': 'FAILURE',
'origin': 'curtin',
'name': 'commissioning',
'description': 'Commissioning',
'timestamp': datetime.utcnow(),
'files': [
{
"path": "sample.txt",
"encoding": "uuencode",
"compression": "bzip2",
"content": encoded_content
}
]
}
with ExpectedException(ValueError):
self.processMessage(node, payload)
评论列表
文章目录