

def test_log_entry_collection_handler(self):
    node_ip = '10.20.0.130'
    log_entries = [[time.strftime(settings.UI_LOG_DATE_FORMAT), 'LEVEL111', 'text1'], [time.strftime(settings.UI_LOG_DATE_FORMAT), 'LEVEL222', 'text2']]
    cluster = self.env.create_cluster()
    node = self.env.create_node(cluster_id=cluster.id, ip=node_ip)
    self._create_logfile_for_node(settings.LOGS[0], log_entries)
    self._create_logfile_for_node(settings.LOGS[1], log_entries, node)
    resp = self.app.get(reverse('LogEntryCollectionHandler'), params={
        'source': settings.LOGS[0]['id'],
    }, headers=self.default_headers)
    self.assertEqual(200, resp.status_code)
    response = resp.json_body
    log_entries['entries'].reverse()
    self.assertEqual(response['entries'], log_entries)
    resp = self.app.get(reverse('LogEntryCollectionHandler'), params={
        'node': node.id,
        'source': settings.LOGS[1]['id'],
    }, headers=self.default_headers)
    self.assertEqual(200, resp.status_code)
    response = resp.json_body
    response['entries'].reverse()
    self.assertEqual(response['entries'], log_entries)

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/unit/test_logs_handlers.py TestLogs.test_log_entry_collection_handler/VarMisuse@163/235 `response`->`log_entries`