def test_invoke(self): m = actions.Trash( {'name': 'trash'}, {'trash-mailbox': 'to-the-trash'}, ) conn = mock.Mock() m.invoke(conn, 'id-here', self.msg) conn.copy.assert_called_once_with(['id-here'], 'to-the-trash')
def test_create_with_dest(self): m = actions.Trash( { 'name': 'trash', 'dest-mailbox': 'local-override' }, {'trash-mailbox': 'to-the-trash'}, ) self.assertEqual('local-override', m._dest_mailbox)
def test_invoke(self): m = actions.Trash( {'name': 'trash'}, {'trash-mailbox': 'to-the-trash'}, ) conn = mock.Mock() m.invoke(conn, 'src-mailbox', 'id-here', self.msg) conn.move_message.assert_called_once_with('src-mailbox', 'to-the-trash', 'id-here', self.msg)
def test_create(self): m = actions.Trash( {'name': 'trash'}, {'trash-mailbox': 'to-the-trash'}, ) self.assertEqual('to-the-trash', m._dest_mailbox)