How to use test_create_keypair_when_public_key_bits_exceeds_maximum method in tempest

Best Python code snippet using tempest_python

test_keypairs_negative.py

Source:test_keypairs_negative.py Github

copy

Full Screen

...42 self.assertRaises(lib_exc.BadRequest, self._create_keypair,43 k_name, pub_key)44 @test.attr(type=['negative'])45 @test.idempotent_id('fc100c19-2926-4b9c-8fdc-d0589ee2f9ff')46 def test_create_keypair_when_public_key_bits_exceeds_maximum(self):47 # Keypair should not be created when public key bits are too long48 k_name = data_utils.rand_name("keypair")49 pub_key = 'ssh-rsa ' + 'A' * 2048 + ' openstack@ubuntu'50 self.assertRaises(lib_exc.BadRequest, self._create_keypair,51 k_name, pub_key)52 @test.attr(type=['negative'])53 @test.idempotent_id('0359a7f1-f002-4682-8073-0c91e4011b7c')54 def test_create_keypair_with_duplicate_name(self):55 # Keypairs with duplicate names should not be created56 k_name = data_utils.rand_name('keypair')57 self.client.create_keypair(name=k_name)58 # Now try the same keyname to create another key59 self.assertRaises(lib_exc.Conflict, self._create_keypair,60 k_name)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful