

def test_message_flags_changed(self):
    from tinymail.account import folder_updated
    account = _account_for_test()
    msg13_bis_data = (13, set(['\\Flagged']), 'Subject: test message')
    with mock_worker(fol1={
        13: msg13_data,
    }):
        account.perform_update()
    with mock_worker(fol1={
        13: msg13_bis_data,
    }):
        with listen_for(folder_updated) as caught_signals:
            account.perform_update()
    fol1 = account.get_folder('fol1')
    self.assertEqual([m.flags for m in fol1.list_messages()], [set(['\\Flagged'])])
    event_data = {
        'added': [],
        'removed': [],
        'flags_changed': [13],
    }
    self.assertEqual(caught_signals, [(fol1, event_data)])

dataset/ETHPy150Open mgax/tinymail/src/tinymail/tests/test_account.py AccountUpdateTest.test_message_flags_changed/original