"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/credential/test_backend_sql.py" between
keystone-17.0.0.tar.gz and keystone-18.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Victoria" series (latest release).

test_backend_sql.py  (keystone-17.0.0):test_backend_sql.py  (keystone-18.0.0)
skipping to change at line 15 skipping to change at line 15
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import uuid import uuid
from oslo_config import fixture as config_fixture
from keystone.common import provider_api from keystone.common import provider_api
from keystone.credential.providers import fernet as credential_provider from keystone.credential.providers import fernet as credential_provider
from keystone.tests import unit from keystone.tests import unit
from keystone.tests.unit import default_fixtures from keystone.tests.unit import default_fixtures
from keystone.tests.unit import ksfixtures from keystone.tests.unit import ksfixtures
from keystone.tests.unit.ksfixtures import database from keystone.tests.unit.ksfixtures import database
from keystone.credential.backends import sql as credential_sql from keystone.credential.backends import sql as credential_sql
from keystone import exception
PROVIDERS = provider_api.ProviderAPIs PROVIDERS = provider_api.ProviderAPIs
class SqlTests(unit.SQLDriverOverrides, unit.TestCase): class SqlTests(unit.SQLDriverOverrides, unit.TestCase):
def setUp(self): def setUp(self):
super(SqlTests, self).setUp() super(SqlTests, self).setUp()
self.useFixture(database.Database()) self.useFixture(database.Database())
self.load_backends() self.load_backends()
# populate the engine with tables & fixtures # populate the engine with tables & fixtures
skipping to change at line 103 skipping to change at line 106
cred_dict = { cred_dict = {
'id': uuid.uuid4().hex, 'id': uuid.uuid4().hex,
'type': uuid.uuid4().hex, 'type': uuid.uuid4().hex,
'hash': uuid.uuid4().hex, 'hash': uuid.uuid4().hex,
'encrypted_blob': b'randomdata' 'encrypted_blob': b'randomdata'
} }
ref = credential_sql.CredentialModel.from_dict(cred_dict) ref = credential_sql.CredentialModel.from_dict(cred_dict)
# Make sure CredentialModel is handing over a text string # Make sure CredentialModel is handing over a text string
# to the database. To avoid encoding issues # to the database. To avoid encoding issues
self.assertIsInstance(ref.encrypted_blob, str) self.assertIsInstance(ref.encrypted_blob, str)
def test_credential_limits(self):
config_fixture_ = self.user = self.useFixture(config_fixture.Config())
config_fixture_.config(group='credential', user_limit=4)
self._create_credential_with_user_id(self.user_foo['id'])
self.assertRaises(exception.CredentialLimitExceeded,
self._create_credential_with_user_id,
self.user_foo['id'])
 End of changes. 3 change blocks. 
0 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)