# Path: yithlibraryserver/user/idp.py
# def add_identity_provider(config, name):
#     log.debug('Registering identity provider "%s"' % name)
# 
#     if not hasattr(config.registry, 'identity_providers'):
#         config.registry.identity_providers = []
# 
#     config.registry.identity_providers.append(IdentityProvider(name))


import unittest
from pyramid import testing
from yithlibraryserver.user.idp import add_identity_provider
#
# Yith Library Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Yith Library Server is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Yith Library Server.  If not, see <http://www.gnu.org/licenses/>.





class IdentityProviderTests(unittest.TestCase):

    def setUp(self):
        self.config = testing.setUp()

    def tearDown(self):
        testing.tearDown()

    def test_add_identity_provider(self):
        self.config.add_directive('add_identity_provider',
                                  add_identity_provider)


# Path: yithlibraryserver/user/idp.py
# def add_identity_provider(config, name):
#     log.debug('Registering identity provider "%s"' % name)
# 
#     if not hasattr(config.registry, 'identity_providers'):
#         config.registry.identity_providers = []
# 
#     config.registry.identity_providers.append(IdentityProvider(name))


# Path: yithlibraryserver/user/tests/test_idp.py
import unittest
from pyramid import testing
from yithlibraryserver.user.idp import add_identity_provider

#
# Yith Library Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Yith Library Server is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Yith Library Server.  If not, see <http://www.gnu.org/licenses/>.





class IdentityProviderTests(unittest.TestCase):

    def setUp(self):
        self.config = testing.setUp()

    def tearDown(self):
        testing.tearDown()

    def test_add_identity_provider(self):
        self.config.add_directive('add_identity_provider',
                                  add_identity_provider)


        self.config.add_identity_provider('provider1')