summaryrefslogtreecommitdiff
path: root/service/test/adapter/test_helper.py
blob: 94158f1cbff79f3e8d29f9905fefc28e6c37e610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from mock import Mock

LEAP_FLAGS = ['\\Seen',
              '\\Answered',
              '\\Flagged',
              '\\Deleted',
              '\\Draft',
              '\\Recent',
              'List']

def leap_mail(uid=0, extra_flags=[], headers={}):
  flags = LEAP_FLAGS + extra_flags
  return Mock(getUID=Mock(return_value=uid),
              getFlags=Mock(return_value=flags),
              bdoc=Mock(content={'raw': 'test'}),
              hdoc=Mock(content={'headers': headers}))