~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/tests/test_client.py

  • Committer: Curtis Hovey
  • Date: 2012-01-31 04:51:19 UTC
  • mto: This revision was merged to the branch mainline in revision 37.
  • Revision ID: curtis.hovey@canonical.com-20120131045119-i67ko7uip7gr45ek
rename in_reply_to => replies to avoid confusion with real header.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        'hidden': hidden,
40
40
        'attachments': [],
41
41
        'body': body,
42
 
        'replies': [],
43
42
        }
44
43
    if 'in-reply-to' in headers:
45
 
        message['in_reply_to'] = headers['in-reply-to']
 
44
        message['replies'] = headers['in-reply-to']
46
45
    return message
47
46
 
48
47
 
74
73
    count = 0
75
74
    pending = []
76
75
    for message in messages:
77
 
        if message.get('in_reply_to') is None:
 
76
        if message.get('replies') is None:
78
77
            threads[message['message_id']] = [message]
79
78
            count += 1
80
79
        else:
81
80
            pending.append(message)
82
81
    for message in pending:
83
 
        threads[message['in_reply_to']].append(message)
 
82
        threads[message['replies']].append(message)
84
83
    return threads.values()
85
84
 
86
85