test/analyzer: check that last message is StoppedMessage

This commit is contained in:
Sebastien Bourdeauducq 2016-03-15 21:44:56 +08:00
parent 1bbef94061
commit 9ffaf82877
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
from artiq.experiment import * from artiq.experiment import *
from artiq.coredevice.analyzer import decode_dump, OutputMessage, InputMessage from artiq.coredevice.analyzer import (decode_dump, StoppedMessage,
OutputMessage, InputMessage)
from artiq.test.hardware_testbench import ExperimentCase from artiq.test.hardware_testbench import ExperimentCase
@ -30,6 +31,7 @@ class AnalyzerTest(ExperimentCase):
exp.run() exp.run()
dump = decode_dump(comm.get_analyzer_dump()) dump = decode_dump(comm.get_analyzer_dump())
self.assertIsInstance(dump.messages[-1], StoppedMessage)
output_messages = [msg for msg in dump.messages output_messages = [msg for msg in dump.messages
if isinstance(msg, OutputMessage) if isinstance(msg, OutputMessage)
and msg.address == 0] and msg.address == 0]