# Path: networking_odl/common/lightweight_testing.py
# LOG = logging.getLogger(__name__)
# OK = requests.codes.ok
# NO_CONTENT = requests.codes.no_content
# NOT_ALLOWED = requests.codes.not_allowed
# NOT_FOUND = requests.codes.not_found
# BAD_REQUEST = requests.codes.bad_request
# class OpenDaylightLwtClient(client.OpenDaylightRestClient):
#     def _make_response(cls, status_code=OK, content=None):
#     def _get_resource_id(cls, urlpath):
#     def post(cls, resource_type, resource_dict, urlpath, resource_list):
#     def put(cls, resource_type, resource_dict, urlpath, resource_list):
#     def delete(cls, resource_type, resource_dict, urlpath, resource_list):
#     def get(cls, resource_type, resource_dict, urlpath, resource_list=None):
#     def sendjson(self, method, urlpath, obj=None):
# 
# Path: networking_odl/tests/base.py
# class DietTestCase(base.DietTestCase):
# class OpenDaylightRestClientFixture(fixtures.Fixture):
# class OpenDaylightRestClientGlobalFixture(fixtures.Fixture):
# class OpenDaylightFeaturesFixture(fixtures.Fixture):
# class OpenDaylightJournalThreadFixture(fixtures.Fixture):
# class JournalWorkerPidFileFixture(fixtures.Fixture):
# class OpenDaylightPeriodicTaskFixture(fixtures.Fixture):
# class OpenDaylightPseudoAgentPrePopulateFixture(
#         nl_fixture.CallbackRegistryFixture):
# class OpenDaylightFullSyncFixture(fixtures.Fixture):
#     def patch(self, target, name, *args, **kwargs):
#     def _setUp(self):
#     def __init__(self, global_client):
#     def _setUp(self):
#     def _setUp(self):
#     def _setUp(self):
#     def remock_atexit(self):
#     def _setUp(self):
#     def _setUp(self):
#     def _setUp(self):
#     def _restore(self):
#     def _setUp(self):


from unittest import mock
from neutron.tests import base
from oslo_config import fixture as config_fixture
from networking_odl.common import lightweight_testing as lwt
from networking_odl.tests import base as odl_base
        from networking_odl.common import client as odl_client
        from networking_odl.common import client as odl_client
    def test_post_single_resource(self):
        client = lwt.OpenDaylightLwtClient.create_client()
        fake_network1 = {'id': 'fakeid1', 'name': 'fake_network1'}
        obj = {'networks': fake_network1}
        response = client.sendjson('post', 'networks', obj)
        self.assertEqual(lwt.NO_CONTENT, response.status_code)
        lwt_dict = lwt.OpenDaylightLwtClient.lwt_dict
        self.assertEqual(lwt_dict['networks']['fakeid1'],
                         fake_network1)

    @mock.patch.dict(lwt.OpenDaylightLwtClient.lwt_dict,
                     {'networks': {}}, clear=True)
    def test_post_multiple_resources(self):
        client = lwt.OpenDaylightLwtClient.create_client()
        fake_network1 = {'id': 'fakeid1', 'name': 'fake_network1'}
        fake_network2 = {'id': 'fakeid2', 'name': 'fake_network2'}
        obj = {'networks': [fake_network1, fake_network2]}
        response = client.sendjson('post', 'networks', obj)
        self.assertEqual(lwt.NO_CONTENT, response.status_code)
        lwt_dict = lwt.OpenDaylightLwtClient.lwt_dict
        self.assertEqual(lwt_dict['networks']['fakeid1'],
                         fake_network1)
        self.assertEqual(lwt_dict['networks']['fakeid2'],
                         fake_network2)

    @mock.patch.dict(lwt.OpenDaylightLwtClient.lwt_dict,
                     {'ports': {'fakeid1': {'id': 'fakeid1',
                                            'name': 'fake_port1'}}},
                     clear=True)
    def test_get_single_resource(self):

# Path: networking_odl/common/lightweight_testing.py
# LOG = logging.getLogger(__name__)
# OK = requests.codes.ok
# NO_CONTENT = requests.codes.no_content
# NOT_ALLOWED = requests.codes.not_allowed
# NOT_FOUND = requests.codes.not_found
# BAD_REQUEST = requests.codes.bad_request
# class OpenDaylightLwtClient(client.OpenDaylightRestClient):
#     def _make_response(cls, status_code=OK, content=None):
#     def _get_resource_id(cls, urlpath):
#     def post(cls, resource_type, resource_dict, urlpath, resource_list):
#     def put(cls, resource_type, resource_dict, urlpath, resource_list):
#     def delete(cls, resource_type, resource_dict, urlpath, resource_list):
#     def get(cls, resource_type, resource_dict, urlpath, resource_list=None):
#     def sendjson(self, method, urlpath, obj=None):
# 
# Path: networking_odl/tests/base.py
# class DietTestCase(base.DietTestCase):
# class OpenDaylightRestClientFixture(fixtures.Fixture):
# class OpenDaylightRestClientGlobalFixture(fixtures.Fixture):
# class OpenDaylightFeaturesFixture(fixtures.Fixture):
# class OpenDaylightJournalThreadFixture(fixtures.Fixture):
# class JournalWorkerPidFileFixture(fixtures.Fixture):
# class OpenDaylightPeriodicTaskFixture(fixtures.Fixture):
# class OpenDaylightPseudoAgentPrePopulateFixture(
#         nl_fixture.CallbackRegistryFixture):
# class OpenDaylightFullSyncFixture(fixtures.Fixture):
#     def patch(self, target, name, *args, **kwargs):
#     def _setUp(self):
#     def __init__(self, global_client):
#     def _setUp(self):
#     def _setUp(self):
#     def _setUp(self):
#     def remock_atexit(self):
#     def _setUp(self):
#     def _setUp(self):
#     def _setUp(self):
#     def _restore(self):
#     def _setUp(self):


# Path: networking_odl/tests/unit/common/test_lightweight_testing.py
from unittest import mock
from neutron.tests import base
from oslo_config import fixture as config_fixture
from networking_odl.common import lightweight_testing as lwt
from networking_odl.tests import base as odl_base
        from networking_odl.common import client as odl_client
        from networking_odl.common import client as odl_client

    def test_post_single_resource(self):
        client = lwt.OpenDaylightLwtClient.create_client()
        fake_network1 = {'id': 'fakeid1', 'name': 'fake_network1'}
        obj = {'networks': fake_network1}
        response = client.sendjson('post', 'networks', obj)
        self.assertEqual(lwt.NO_CONTENT, response.status_code)
        lwt_dict = lwt.OpenDaylightLwtClient.lwt_dict
        self.assertEqual(lwt_dict['networks']['fakeid1'],
                         fake_network1)

    @mock.patch.dict(lwt.OpenDaylightLwtClient.lwt_dict,
                     {'networks': {}}, clear=True)
    def test_post_multiple_resources(self):
        client = lwt.OpenDaylightLwtClient.create_client()
        fake_network1 = {'id': 'fakeid1', 'name': 'fake_network1'}
        fake_network2 = {'id': 'fakeid2', 'name': 'fake_network2'}
        obj = {'networks': [fake_network1, fake_network2]}
        response = client.sendjson('post', 'networks', obj)
        self.assertEqual(lwt.NO_CONTENT, response.status_code)
        lwt_dict = lwt.OpenDaylightLwtClient.lwt_dict
        self.assertEqual(lwt_dict['networks']['fakeid1'],
                         fake_network1)
        self.assertEqual(lwt_dict['networks']['fakeid2'],
                         fake_network2)

    @mock.patch.dict(lwt.OpenDaylightLwtClient.lwt_dict,
                     {'ports': {'fakeid1': {'id': 'fakeid1',
                                            'name': 'fake_port1'}}},
                     clear=True)
    def test_get_single_resource(self):

        client = lwt.OpenDaylightLwtClient.create_client()