'Verify that list_cached() method correctly processes images with all
filled data and images with not filled \'last_accessed\' field.'

@mock.patch.object(glance.image_cache.client.CacheClient, 'get_cached_images')
@mock.patch.object(prettytable.PrettyTable, 'add_row')
def test_list_cached_images(self, mock_row_create, mock_images):

    mock_images.return_value = [{'last_accessed': float(0), 'last_modified': float(1378985797.124511), 'image_id': '1', 'size': '128', 'hits': '1'}, {'last_accessed': float(1378985797.124511), 'last_modified': float(1378985797.124511), 'image_id': '2', 'size': '255', 'hits': '2'}]
    cache_manage.list_cached(mock.Mock(), '')
    self.assertEqual(len(mock_images.return_value), mock_row_create.call_count)
