# Path: networking_odl/ceilometer/network/statistics/opendaylight_v2/driver.py
# LOG = log.getLogger(__name__)
# INT64_MAX_VALUE = (2 ** 64 / 2 - 1)
# class OpenDaylightDriver(driver.Driver):
#     def _get_int_sample(key, statistic, resource_id,
#                         resource_meta, tenant_id):
#     def _prepare_cache(self, endpoint, params, cache):
#     def get_sample_data(self, meter_name, parse_url, params, cache):
#     def _get_iter(self, meter_name):
#     def _get_extractor(self, meter_name):
#     def _iter_switch(extractor, data):
#     def _switch(statistic, resource_id,
#                 resource_meta, tenant_id):
#     def _switch_ports(statistic, resource_id,
#                       resource_meta, tenant_id):
#     def _iter_switch_port(extractor, data):
#     def _iter_port(extractor, data):
#     def _port(statistic, resource_id, resource_meta, tenant_id):
#     def _port_uptime(statistic, resource_id,
#                      resource_meta, tenant_id):
#     def _port_receive_packets(statistic, resource_id,
#                               resource_meta, tenant_id):
#     def _port_transmit_packets(statistic, resource_id,
#                                resource_meta, tenant_id):
#     def _port_receive_bytes(statistic, resource_id,
#                             resource_meta, tenant_id):
#     def _port_transmit_bytes(statistic, resource_id,
#                              resource_meta, tenant_id):
#     def _port_receive_drops(statistic, resource_id,
#                             resource_meta, tenant_id):
#     def _port_receive_errors(statistic, resource_id,
#                              resource_meta, tenant_id):
#     def _iter_table(extractor, data):
#     def _switch_table_active_entries(statistic, resource_id,
#                                      resource_meta, tenant_id):


import abc
import urllib
from unittest import mock
from oslotest import base
from ceilometer import service
from networking_odl.ceilometer.network.statistics.opendaylight_v2 import driver
from oslo_utils import uuidutils
                                                  self.fake_params,
                                                  {})
        self.assertIsNone(sample_data)

    def test_cache(self):
        cache = {}
        self.driver.get_sample_data('switch',
                                    self.fake_odl_url,
                                    self.fake_params,
                                    cache)
        self.driver.get_sample_data('switch',
                                    self.fake_odl_url,
                                    self.fake_params,
                                    cache)
        self.assertEqual(1, self.get_statistics.call_count)

        cache = {}
        self.driver.get_sample_data('switch',
                                    self.fake_odl_url,
                                    self.fake_params,
                                    cache)
        self.assertEqual(2, self.get_statistics.call_count)

    def test_http_error(self):

        mock.patch(
            'networking_odl.ceilometer.network.statistics.opendaylight_v2.'
            'client.SwitchStatisticsAPIClient.get_statistics',
            side_effect=Exception()).start()


# Path: networking_odl/ceilometer/network/statistics/opendaylight_v2/driver.py
# LOG = log.getLogger(__name__)
# INT64_MAX_VALUE = (2 ** 64 / 2 - 1)
# class OpenDaylightDriver(driver.Driver):
#     def _get_int_sample(key, statistic, resource_id,
#                         resource_meta, tenant_id):
#     def _prepare_cache(self, endpoint, params, cache):
#     def get_sample_data(self, meter_name, parse_url, params, cache):
#     def _get_iter(self, meter_name):
#     def _get_extractor(self, meter_name):
#     def _iter_switch(extractor, data):
#     def _switch(statistic, resource_id,
#                 resource_meta, tenant_id):
#     def _switch_ports(statistic, resource_id,
#                       resource_meta, tenant_id):
#     def _iter_switch_port(extractor, data):
#     def _iter_port(extractor, data):
#     def _port(statistic, resource_id, resource_meta, tenant_id):
#     def _port_uptime(statistic, resource_id,
#                      resource_meta, tenant_id):
#     def _port_receive_packets(statistic, resource_id,
#                               resource_meta, tenant_id):
#     def _port_transmit_packets(statistic, resource_id,
#                                resource_meta, tenant_id):
#     def _port_receive_bytes(statistic, resource_id,
#                             resource_meta, tenant_id):
#     def _port_transmit_bytes(statistic, resource_id,
#                              resource_meta, tenant_id):
#     def _port_receive_drops(statistic, resource_id,
#                             resource_meta, tenant_id):
#     def _port_receive_errors(statistic, resource_id,
#                              resource_meta, tenant_id):
#     def _iter_table(extractor, data):
#     def _switch_table_active_entries(statistic, resource_id,
#                                      resource_meta, tenant_id):


# Path: networking_odl/tests/unit/ceilometer/network/statistics/opendaylight_v2/test_driver.py
import abc
import urllib
from unittest import mock
from oslotest import base
from ceilometer import service
from networking_odl.ceilometer.network.statistics.opendaylight_v2 import driver
from oslo_utils import uuidutils

                                                  self.fake_params,
                                                  {})
        self.assertIsNone(sample_data)

    def test_cache(self):
        cache = {}
        self.driver.get_sample_data('switch',
                                    self.fake_odl_url,
                                    self.fake_params,
                                    cache)
        self.driver.get_sample_data('switch',
                                    self.fake_odl_url,
                                    self.fake_params,
                                    cache)
        self.assertEqual(1, self.get_statistics.call_count)

        cache = {}
        self.driver.get_sample_data('switch',
                                    self.fake_odl_url,
                                    self.fake_params,
                                    cache)
        self.assertEqual(2, self.get_statistics.call_count)

    def test_http_error(self):

        mock.patch(
            'networking_odl.ceilometer.network.statistics.opendaylight_v2.'
            'client.SwitchStatisticsAPIClient.get_statistics',
            side_effect=Exception()).start()


        sample_data = self.driver.get_sample_data('switch',