<s> import mock <EOL> import testtools <EOL> from openstack . message . v1 import queue <EOL> FAKE_NAME = '<STR_LIT>' <EOL> FAKE = { <EOL> '<STR_LIT:name>' : FAKE_NAME , <EOL> } <EOL> class TestQueue ( testtools . TestCase ) : <EOL> def test_basic ( self ) : <EOL> sot = queue . Queue ( ) <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 . assertFalse ( sot . allow_retrieve ) <EOL> self . assertFalse ( sot . allow_update ) <EOL> self . assertTrue ( sot . allow_delete ) <EOL> self . assertFalse ( sot . allow_list ) <EOL> def test_make_it ( self ) : <EOL> sot = queue . Queue ( FAKE ) <EOL> self . assertEqual ( FAKE [ '<STR_LIT:name>' ] , sot . name ) <EOL> def test_create ( self ) : <EOL> sess = mock . Mock ( ) <EOL> sess . put = mock . Mock ( ) <EOL> sess . put . return_value = mock . Mock ( ) <EOL> sot = queue . Queue ( FAKE ) <EOL> sot . create ( sess ) <EOL> url = '<STR_LIT>' % FAKE_NAME <EOL> headers = { '<STR_LIT>' : '<STR_LIT>' } <EOL> sess . put . assert_called_with ( url , endpoint_filter = sot . service , <EOL> headers = headers ) <EOL> self . assertEqual ( FAKE_NAME , sot . id ) <EOL> self . assertEqual ( FAKE_NAME , sot . name ) </s>
