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')
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 def test_create(self):
     m = actions.Trash(
         {'name': 'trash'},
         {'trash-mailbox': 'to-the-trash'},
     )
     self.assertEqual('to-the-trash', m._dest_mailbox)