~unity-2d-team/unity-2d/Shell-MultiMonitor

« back to all changes in this revision

Viewing changes to grackle/tests/test_model.py

  • Committer: William Grant
  • Date: 2012-01-23 05:09:45 UTC
  • Revision ID: william.grant@canonical.com-20120123050945-0qirjil4i8toqqr7
content -> raw

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
 
97
97
        # The stored message contains the full original text of the
98
98
        # message, as well as interesting fields parsed out.
99
 
        self.assertEqual(TEST_MESSAGE, cmsg['content'])
 
99
        self.assertEqual(TEST_MESSAGE, cmsg['raw'])
100
100
        parsed_message = _parse_message(TEST_MESSAGE)[1]
101
101
        for key, value in parsed_message.iteritems():
102
102
            self.assertEqual(value, cmsg[key])
134
134
        self.assertMessages([0], messages)
135
135
        cmsg = messages[0]
136
136
 
137
 
        # The content matches what we generated, and the result is
 
137
        # The raw message matches what we generated, and the result is
138
138
        # formatted according to the default settings.
139
 
        expected_content = TEMPLATE_MESSAGE.format(
 
139
        expected_raw = TEMPLATE_MESSAGE.format(
140
140
            date=formatdate(0), id='<message0@example.com>')
141
 
        self.assertEqual(expected_content, messages[0]['content'])
142
 
        pmsg = _parse_message(expected_content)[1]
143
 
        pmsg['content'] = expected_content
 
141
        self.assertEqual(expected_raw, messages[0]['raw'])
 
142
        pmsg = _parse_message(expected_raw)[1]
 
143
        pmsg['raw'] = expected_raw
144
144
        self.assertEqual(
145
145
            _format_message(
146
146
                pmsg,
209
209
 
210
210
    def test_all(self):
211
211
        parsed = _parse_message(TEST_MESSAGE)[1]
212
 
        parsed['content'] = TEST_MESSAGE
 
212
        parsed['raw'] = TEST_MESSAGE
213
213
        formatted = _format_message(
214
214
            parsed,
215
215
            headers=['date', 'from', 'subject', 'message-id'],
221
221
                'message-id': '<aaaaaaaaaaaaa@example.com>',
222
222
                'subject': 'Everything is broken',
223
223
                },
224
 
            'content': TEST_MESSAGE,
 
224
            'raw': TEST_MESSAGE,
225
225
            }
226
226
        self.assertEqual(expected, formatted)