<s> from cinderclient . tests . unit import utils <EOL> from cinderclient . tests . unit . v2 import fakes <EOL> cs = fakes . FakeClient ( ) <EOL> class cgsnapshotsTest ( utils . TestCase ) : <EOL> def test_delete_cgsnapshot ( self ) : <EOL> v = cs . cgsnapshots . list ( ) [ <NUM_LIT:0> ] <EOL> vol = v . delete ( ) <EOL> self . _assert_request_id ( vol ) <EOL> cs . assert_called ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> vol = cs . cgsnapshots . delete ( '<STR_LIT>' ) <EOL> cs . assert_called ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . _assert_request_id ( vol ) <EOL> vol = cs . cgsnapshots . delete ( v ) <EOL> cs . assert_called ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . _assert_request_id ( vol ) <EOL> def test_create_cgsnapshot ( self ) : <EOL> vol = cs . cgsnapshots . create ( '<STR_LIT>' ) <EOL> cs . assert_called ( '<STR_LIT:POST>' , '<STR_LIT>' ) <EOL> self . _assert_request_id ( vol ) <EOL> def test_create_cgsnapshot_with_cg_id ( self ) : <EOL> vol = cs . cgsnapshots . create ( '<STR_LIT>' ) <EOL> expected = { '<STR_LIT>' : { '<STR_LIT:status>' : '<STR_LIT>' , <EOL> '<STR_LIT:description>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT:name>' : None , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : None } } <EOL> cs . assert_called ( '<STR_LIT:POST>' , '<STR_LIT>' , body = expected ) <EOL> self . _assert_request_id ( vol ) <EOL> def test_update_cgsnapshot ( self ) : <EOL> v = cs . cgsnapshots . list ( ) [ <NUM_LIT:0> ] <EOL> expected = { '<STR_LIT>' : { '<STR_LIT:name>' : '<STR_LIT>' } } <EOL> vol = v . update ( name = '<STR_LIT>' ) <EOL> cs . assert_called ( '<STR_LIT>' , '<STR_LIT>' , body = expected ) <EOL> self . _assert_request_id ( vol ) <EOL> vol = cs . cgsnapshots . update ( '<STR_LIT>' , name = '<STR_LIT>' ) <EOL> cs . assert_called ( '<STR_LIT>' , '<STR_LIT>' , body = expected ) <EOL> self . _assert_request_id ( vol ) <EOL> vol = cs . cgsnapshots . update ( v , name = '<STR_LIT>' ) <EOL> cs . assert_called ( '<STR_LIT>' , '<STR_LIT>' , body = expected ) <EOL> self . _assert_request_id ( vol ) <EOL> def test_update_cgsnapshot_no_props ( self ) : <EOL> cs . cgsnapshots . update ( '<STR_LIT>' ) <EOL> def test_list_cgsnapshot ( self ) : <EOL> lst = cs . cgsnapshots . list ( ) <EOL> cs . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . _assert_request_id ( lst ) <EOL> def test_list_cgsnapshot_detailed_false ( self ) : <EOL> lst = cs . cgsnapshots . list ( detailed = False ) <EOL> cs . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . _assert_request_id ( lst ) <EOL> def test_list_cgsnapshot_with_search_opts ( self ) : <EOL> lst = cs . cgsnapshots . list ( search_opts = { '<STR_LIT:foo>' : '<STR_LIT:bar>' } ) <EOL> cs . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . _assert_request_id ( lst ) <EOL> def test_list_cgsnapshot_with_empty_search_opt ( self ) : <EOL> lst = cs . cgsnapshots . list ( search_opts = { '<STR_LIT:foo>' : '<STR_LIT:bar>' , '<STR_LIT>' : None } ) <EOL> cs . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . _assert_request_id ( lst ) <EOL> def test_get_cgsnapshot ( self ) : <EOL> cgsnapshot_id = '<STR_LIT>' <EOL> vol = cs . cgsnapshots . get ( cgsnapshot_id ) <EOL> cs . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' % cgsnapshot_id ) <EOL> self . _assert_request_id ( vol ) </s>
