예제 #1
0
def test_create_invalid_message_type(msgid, expected):
    with pytest.raises(InvalidMessageError) as cm:
        utils.MessageDefinition("checker", msgid, "msg", "descr", "symbol",
                                "scope")
    assert str(cm.value) == expected
예제 #2
0
 def test_create_invalid_message_type(self):
     with self.assertRaises(InvalidMessageError) as cm:
         utils.MessageDefinition('checker', 'Q1234', 'msg', 'descr',
                                 'symbol', 'scope')
     self.assertEqual(str(cm.exception), "Bad message type Q in 'Q1234'")
예제 #3
0
def test_create_invalid_message_type(msgid, expected):
    with pytest.raises(InvalidMessageError) as cm:
        utils.MessageDefinition('checker', msgid, 'msg', 'descr', 'symbol',
                                'scope')
    assert str(cm.value) == expected
예제 #4
0
 def test_create_invalid_msgid(self):
     with self.assertRaises(InvalidMessageError) as cm:
         utils.MessageDefinition('checker', 'W12345', 'msg', 'descr',
                                 'symbol', 'scope')
     self.assertEqual(str(cm.exception), "Invalid message id 'W12345'")