<s> from tempest_lib . common . utils import data_utils <EOL> from functional . tests . identity . v3 import test_identity <EOL> class UserTests ( test_identity . IdentityTests ) : <EOL> def test_user_create ( self ) : <EOL> self . _create_dummy_user ( ) <EOL> def test_user_delete ( self ) : <EOL> username = self . _create_dummy_user ( add_clean_up = False ) <EOL> raw_output = self . openstack ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % { '<STR_LIT>' : self . domain_name , <EOL> '<STR_LIT:name>' : username } ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( raw_output ) ) <EOL> def test_user_list ( self ) : <EOL> raw_output = self . openstack ( '<STR_LIT>' ) <EOL> items = self . parse_listing ( raw_output ) <EOL> self . assert_table_structure ( items , test_identity . BASIC_LIST_HEADERS ) <EOL> def test_user_set ( self ) : <EOL> username = self . _create_dummy_user ( ) <EOL> raw_output = self . openstack ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % { '<STR_LIT>' : self . domain_name , <EOL> '<STR_LIT:name>' : username } ) <EOL> user = self . parse_show_as_object ( raw_output ) <EOL> new_username = data_utils . rand_name ( '<STR_LIT>' ) <EOL> new_email = data_utils . rand_name ( ) + '<STR_LIT>' <EOL> raw_output = self . openstack ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % { '<STR_LIT:email>' : new_email , <EOL> '<STR_LIT>' : new_username , <EOL> '<STR_LIT:id>' : user [ '<STR_LIT:id>' ] } ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( raw_output ) ) <EOL> raw_output = self . openstack ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % { '<STR_LIT>' : self . domain_name , <EOL> '<STR_LIT:name>' : new_username } ) <EOL> updated_user = self . parse_show_as_object ( raw_output ) <EOL> self . assertEqual ( user [ '<STR_LIT:id>' ] , updated_user [ '<STR_LIT:id>' ] ) <EOL> self . assertEqual ( new_email , updated_user [ '<STR_LIT:email>' ] ) <EOL> def test_user_set_default_project_id ( self ) : <EOL> username = self . _create_dummy_user ( ) <EOL> project_name = self . _create_dummy_project ( ) <EOL> raw_output = self . openstack ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % { '<STR_LIT>' : self . domain_name , <EOL> '<STR_LIT:name>' : username } ) <EOL> user = self . parse_show_as_object ( raw_output ) <EOL> raw_output = self . openstack ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % { '<STR_LIT>' : project_name , <EOL> '<STR_LIT>' : <EOL> self . domain_name , <EOL> '<STR_LIT:id>' : user [ '<STR_LIT:id>' ] } ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( raw_output ) ) <EOL> raw_output = self . openstack ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % { '<STR_LIT>' : self . domain_name , <EOL> '<STR_LIT:name>' : username } ) <EOL> updated_user = self . parse_show_as_object ( raw_output ) <EOL> raw_output = self . openstack ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % { '<STR_LIT>' : self . domain_name , <EOL> '<STR_LIT:name>' : project_name } ) <EOL> project = self . parse_show_as_object ( raw_output ) <EOL> self . assertEqual ( user [ '<STR_LIT:id>' ] , updated_user [ '<STR_LIT:id>' ] ) <EOL> self . assertEqual ( project [ '<STR_LIT:id>' ] , updated_user [ '<STR_LIT>' ] ) <EOL> def test_user_show ( self ) : <EOL> username = self . _create_dummy_user ( ) <EOL> raw_output = self . openstack ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % { '<STR_LIT>' : self . domain_name , <EOL> '<STR_LIT:name>' : username } ) <EOL> items = self . parse_show ( raw_output ) <EOL> self . assert_show_fields ( items , self . USER_FIELDS ) </s>
