def test_queues(self, httplib_mock):
     reader = mock.MagicMock(name='getresponse_reader')
     rval = json.dumps([{'name': 'foo', 'message_stats': {'publish': 1}}])
     reader.read.return_value = rval
     conn = httplib_mock.return_value
     conn.getresponse.return_value = reader
     data = queues.collect()
     self.assertEqual({'foo_publish': 1}, data)
Beispiel #2
0
 def test_queues(self, httplib_mock):
     reader = mock.MagicMock(name='getresponse_reader')
     rval = json.dumps([{'name': 'foo', 'message_stats': {'publish': 1}}])
     reader.read.return_value = rval
     conn = httplib_mock.return_value
     conn.getresponse.return_value = reader
     data = queues.collect()
     self.assertEqual({'foo_publish': 1}, data)
Beispiel #3
0
def get_queues():
    global queues_data
    queues_data = queues.collect()
Beispiel #4
0
def get_queues():
    global queues_data
    queues_data = queues.collect()