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

« back to all changes in this revision

Viewing changes to grackle/tests/test_client.py

  • Committer: Aaron Bentley
  • Date: 2012-01-12 08:52:25 UTC
  • mto: (6.1.30 trunk)
  • mto: This revision was merged to the branch mainline in revision 45.
  • Revision ID: aaron@canonical.com-20120112085225-ajy6igsil634t0g5
Switch hyphens to underscores.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        self.send_response(httplib.OK)
68
68
        self.end_headers()
69
69
        messages = [m for m in self.server.messages[archive] if 'message_ids'
70
 
                    not in parameters or m['message-id'] in
 
70
                    not in parameters or m['message_id'] in
71
71
                    parameters['message_ids']]
72
72
        response = {
73
73
            'messages': messages,
100
100
        client = GrackleClient('localhost', 8435)
101
101
        with fake_grackle_service(client,
102
102
            {'baz':
103
 
            [{'message-id': 'foo'},
104
 
             {'message-id': 'bar'}]}):
 
103
            [{'message_id': 'foo'},
 
104
             {'message_id': 'bar'}]}):
105
105
            response = client.get_messages('baz')
106
 
        self.assertEqual(['bar', 'foo'], sorted(m['message-id'] for m in
 
106
        self.assertEqual(['bar', 'foo'], sorted(m['message_id'] for m in
107
107
            response['messages']))
108
108
        self.assertIs(None, response['next_memo'])
109
109
        self.assertIs(None, response['previous_memo'])
112
112
        client = GrackleClient('localhost', 8437)
113
113
        with fake_grackle_service(client,
114
114
            {'baz':
115
 
            [{'message-id': 'foo'},
116
 
             {'message-id': 'bar'}]}):
 
115
            [{'message_id': 'foo'},
 
116
             {'message_id': 'bar'}]}):
117
117
            response = client.get_messages('baz', message_ids=['foo'])
118
118
        message, = response['messages']
119
 
        self.assertEqual('foo', message['message-id'])
 
119
        self.assertEqual('foo', message['message_id'])