<s> import copy <EOL> import testtools <EOL> from openstack . network . v2 import pool_member <EOL> IDENTIFIER = '<STR_LIT>' <EOL> EXAMPLE = { <EOL> '<STR_LIT:address>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT:id>' : IDENTIFIER , <EOL> '<STR_LIT>' : '<STR_LIT:4>' , <EOL> '<STR_LIT>' : <NUM_LIT:5> , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT:7> , <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> } <EOL> class TestPoolMember ( testtools . TestCase ) : <EOL> def test_basic ( self ) : <EOL> sot = pool_member . PoolMember ( ) <EOL> self . assertEqual ( '<STR_LIT>' , sot . resource_key ) <EOL> self . assertEqual ( '<STR_LIT>' , sot . resources_key ) <EOL> self . assertEqual ( '<STR_LIT>' , sot . base_path ) <EOL> self . assertEqual ( '<STR_LIT>' , sot . service . service_type ) <EOL> self . assertTrue ( sot . allow_create ) <EOL> self . assertTrue ( sot . allow_retrieve ) <EOL> self . assertTrue ( sot . allow_update ) <EOL> self . assertTrue ( sot . allow_delete ) <EOL> self . assertTrue ( sot . allow_list ) <EOL> def test_make_it ( self ) : <EOL> sot = pool_member . PoolMember ( EXAMPLE ) <EOL> self . assertEqual ( EXAMPLE [ '<STR_LIT:address>' ] , sot . address ) <EOL> self . assertTrue ( sot . is_admin_state_up ) <EOL> self . assertEqual ( EXAMPLE [ '<STR_LIT:id>' ] , sot . id ) <EOL> self . assertEqual ( EXAMPLE [ '<STR_LIT>' ] , sot . project_id ) <EOL> self . assertEqual ( EXAMPLE [ '<STR_LIT>' ] , sot . protocol_port ) <EOL> self . assertEqual ( EXAMPLE [ '<STR_LIT>' ] , sot . subnet_id ) <EOL> self . assertEqual ( EXAMPLE [ '<STR_LIT>' ] , sot . weight ) <EOL> self . assertEqual ( EXAMPLE [ '<STR_LIT:name>' ] , sot . name ) <EOL> def test_create_body ( self ) : <EOL> params = copy . deepcopy ( EXAMPLE ) <EOL> params [ '<STR_LIT>' ] = { '<STR_LIT>' } <EOL> body = pool_member . PoolMember . _get_create_body ( params ) <EOL> self . assertEqual ( EXAMPLE , body [ '<STR_LIT>' ] ) </s>
