def testUIDListLineFormatter(self): """ Test that the function which formats lines in response to a UIDL command does so appropriately. """ UIDs = ["abc", "def", "ghi"] listLines = list(pop3.formatUIDListResponse([], UIDs.__getitem__)) self.assertEqual(listLines, ["+OK \r\n", ".\r\n"]) listLines = list(pop3.formatUIDListResponse([123, 431, 591], UIDs.__getitem__)) self.assertEqual(listLines, ["+OK \r\n", "1 abc\r\n", "2 def\r\n", "3 ghi\r\n", ".\r\n"]) listLines = list(pop3.formatUIDListResponse([0, None, 591], UIDs.__getitem__)) self.assertEqual(listLines, ["+OK \r\n", "1 abc\r\n", "3 ghi\r\n", ".\r\n"])
def test_UIDListLineFormatter(self): """ Test that the function which formats lines in response to a UIDL command does so appropriately. """ uids = ["abc", "def", "ghi"] listLines = list(pop3.formatUIDListResponse([], uids.__getitem__)) self.assertEqual(listLines, [b"+OK \r\n", b".\r\n"]) listLines = list(pop3.formatUIDListResponse([123, 431, 591], uids.__getitem__)) self.assertEqual( listLines, [b"+OK \r\n", b"1 abc\r\n", b"2 def\r\n", b"3 ghi\r\n", b".\r\n"] ) listLines = list(pop3.formatUIDListResponse([0, None, 591], uids.__getitem__)) self.assertEqual(listLines, [b"+OK \r\n", b"1 abc\r\n", b"3 ghi\r\n", b".\r\n"])
def test_UIDListLineFormatter(self): """ Test that the function which formats lines in response to a UIDL command does so appropriately. """ uids = ['abc', 'def', 'ghi'] listLines = list(pop3.formatUIDListResponse([], uids.__getitem__)) self.assertEqual(listLines, [b'+OK \r\n', b'.\r\n']) listLines = list( pop3.formatUIDListResponse([123, 431, 591], uids.__getitem__)) self.assertEqual( listLines, [b'+OK \r\n', b'1 abc\r\n', b'2 def\r\n', b'3 ghi\r\n', b'.\r\n']) listLines = list( pop3.formatUIDListResponse([0, None, 591], uids.__getitem__)) self.assertEqual(listLines, [b'+OK \r\n', b'1 abc\r\n', b'3 ghi\r\n', b'.\r\n'])
def testUIDListLineFormatter(self): """ Test that the function which formats lines in response to a UIDL command does so appropriately. """ UIDs = ['abc', 'def', 'ghi'] listLines = list(pop3.formatUIDListResponse([], UIDs.__getitem__)) self.assertEqual( listLines, ['+OK \r\n', '.\r\n']) listLines = list(pop3.formatUIDListResponse([123, 431, 591], UIDs.__getitem__)) self.assertEqual( listLines, ['+OK \r\n', '1 abc\r\n', '2 def\r\n', '3 ghi\r\n', '.\r\n']) listLines = list(pop3.formatUIDListResponse([0, None, 591], UIDs.__getitem__)) self.assertEqual( listLines, ['+OK \r\n', '1 abc\r\n', '3 ghi\r\n', '.\r\n'])