Fix unwanted AttributeError in messagetypes
This commit is contained in:
parent
c9bc97f4b2
commit
8b065d2e57
|
@ -23,7 +23,7 @@ class Message(MsgBase):
|
|||
self.data["subject"] = data["subject"]
|
||||
self.data["body"] = data["body"]
|
||||
except KeyError as e:
|
||||
logger.error("Missing key %s", e.name)
|
||||
logger.error("Missing key %s", e)
|
||||
return self.data
|
||||
|
||||
def process(self):
|
||||
|
|
|
@ -70,6 +70,14 @@ class TestCore(unittest.TestCase):
|
|||
self.assertEqual(msg_data['subject'], obj3e.subject)
|
||||
self.assertEqual(msg_data['body'], obj3e.body)
|
||||
|
||||
try:
|
||||
MsgEncode({'body': 'A msg with no subject'}, 3)
|
||||
except Exception as e:
|
||||
self.fail(
|
||||
'Exception %s whyle trying to encode message'
|
||||
' with no subject!' % e
|
||||
)
|
||||
|
||||
def _wipe_knownnodes(self):
|
||||
with knownnodes.knownNodesLock:
|
||||
knownnodes.knownNodes = {stream: {} for stream in range(1, 4)}
|
||||
|
|
Reference in New Issue
Block a user