3
0
Fork 0

fix: fix 'no-member' for pylint

This commit is contained in:
Lance Edgar 2025-08-30 20:32:56 -05:00
parent 87af670df6
commit 79bab4f9e1
3 changed files with 16 additions and 16 deletions

View file

@ -30,28 +30,27 @@ class TestMessage(FileTestCase):
def make_message(self, **kwargs):
return mod.Message(**kwargs)
def test_set_recips(self):
def test_get_recips(self):
msg = self.make_message()
self.assertEqual(msg.to, [])
# set as list
msg.set_recips('to', ['sally@example.com'])
self.assertEqual(msg.to, ['sally@example.com'])
recips = msg.get_recips(['sally@example.com'])
self.assertEqual(recips, ['sally@example.com'])
# set as tuple
msg.set_recips('to', ('barney@example.com',))
self.assertEqual(msg.to, ['barney@example.com'])
recips = msg.get_recips(('barney@example.com',))
self.assertEqual(recips, ['barney@example.com'])
# set as string
msg.set_recips('to', 'wilma@example.com')
self.assertEqual(msg.to, ['wilma@example.com'])
recips = msg.get_recips('wilma@example.com')
self.assertEqual(recips, ['wilma@example.com'])
# set as null
msg.set_recips('to', None)
self.assertEqual(msg.to, [])
recips = msg.get_recips(None)
self.assertEqual(recips, [])
# otherwise error
self.assertRaises(ValueError, msg.set_recips, 'to', {'foo': 'foo@example.com'})
self.assertRaises(ValueError, msg.get_recips, {'foo': 'foo@example.com'})
def test_as_string(self):