

def test_keypair_create_public_key(self):
    'Test for create keypair with --public-key option.\n\n        Test steps:\n        1) Create keypair with given public key\n        2) Delete keypair\n        '
    with tempfile.NamedTemporaryFile() as f:
        f.write(self.PUBLIC_KEY)
        f.flush()
        raw_output = self.openstack(('keypair create --public-key %s tmpkey' % f.name))
        self.addCleanup(self.openstack, 'keypair delete tmpkey')
        self.assertIn('tmpkey', raw_output)

dataset/ETHPy150Open dtroyer/python-openstackclient/functional/tests/compute/v2/test_keypair.py KeypairTests.test_keypair_create_public_key/original