<s> import copy <EOL> import json <EOL> from mistralclient . tests . unit . v2 import base <EOL> MEMBER = { <EOL> '<STR_LIT:id>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:status>' : '<STR_LIT>' , <EOL> } <EOL> WORKFLOW_MEMBERS_URL = '<STR_LIT>' % ( MEMBER [ '<STR_LIT>' ] ) <EOL> WORKFLOW_MEMBER_URL = '<STR_LIT>' % ( <EOL> MEMBER [ '<STR_LIT>' ] , MEMBER [ '<STR_LIT>' ] <EOL> ) <EOL> class TestWorkflowMembers ( base . BaseClientV2Test ) : <EOL> def test_create ( self ) : <EOL> mock = self . mock_http_post ( content = MEMBER ) <EOL> mb = self . members . create ( <EOL> MEMBER [ '<STR_LIT>' ] , <EOL> MEMBER [ '<STR_LIT>' ] , <EOL> MEMBER [ '<STR_LIT>' ] <EOL> ) <EOL> self . assertIsNotNone ( mb ) <EOL> mock . assert_called_once_with ( <EOL> WORKFLOW_MEMBERS_URL , <EOL> json . dumps ( { '<STR_LIT>' : MEMBER [ '<STR_LIT>' ] } ) <EOL> ) <EOL> def test_update ( self ) : <EOL> updated_member = copy . copy ( MEMBER ) <EOL> updated_member [ '<STR_LIT:status>' ] = '<STR_LIT>' <EOL> mock = self . mock_http_put ( content = updated_member ) <EOL> mb = self . members . update ( <EOL> MEMBER [ '<STR_LIT>' ] , <EOL> MEMBER [ '<STR_LIT>' ] , <EOL> MEMBER [ '<STR_LIT>' ] <EOL> ) <EOL> self . assertIsNotNone ( mb ) <EOL> mock . assert_called_once_with ( <EOL> WORKFLOW_MEMBER_URL , <EOL> json . dumps ( { "<STR_LIT:status>" : "<STR_LIT>" } ) <EOL> ) <EOL> def test_list ( self ) : <EOL> mock = self . mock_http_get ( content = { '<STR_LIT>' : [ MEMBER ] } ) <EOL> mbs = self . members . list ( MEMBER [ '<STR_LIT>' ] , MEMBER [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( mbs ) ) <EOL> mock . assert_called_once_with ( WORKFLOW_MEMBERS_URL ) <EOL> def test_get ( self ) : <EOL> mock = self . mock_http_get ( content = MEMBER ) <EOL> mb = self . members . get ( <EOL> MEMBER [ '<STR_LIT>' ] , <EOL> MEMBER [ '<STR_LIT>' ] , <EOL> MEMBER [ '<STR_LIT>' ] <EOL> ) <EOL> self . assertIsNotNone ( mb ) <EOL> mock . assert_called_once_with ( WORKFLOW_MEMBER_URL ) <EOL> def test_delete ( self ) : <EOL> mock = self . mock_http_delete ( status_code = <NUM_LIT> ) <EOL> self . members . delete ( <EOL> MEMBER [ '<STR_LIT>' ] , <EOL> MEMBER [ '<STR_LIT>' ] , <EOL> MEMBER [ '<STR_LIT>' ] <EOL> ) <EOL> mock . assert_called_once_with ( WORKFLOW_MEMBER_URL ) </s>
