<s> import os <EOL> import uuid <EOL> from functional . common import test <EOL> class ImageTests ( test . TestCase ) : <EOL> """<STR_LIT>""" <EOL> NAME = uuid . uuid4 ( ) . hex <EOL> OTHER_NAME = uuid . uuid4 ( ) . hex <EOL> HEADERS = [ '<STR_LIT:Name>' ] <EOL> FIELDS = [ '<STR_LIT:name>' ] <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> os . environ [ '<STR_LIT>' ] = '<STR_LIT:1>' <EOL> opts = cls . get_show_opts ( cls . FIELDS ) <EOL> raw_output = cls . openstack ( '<STR_LIT>' + cls . NAME + opts ) <EOL> expected = cls . NAME + '<STR_LIT:\n>' <EOL> cls . assertOutput ( expected , raw_output ) <EOL> @ classmethod <EOL> def tearDownClass ( cls ) : <EOL> raw_output = cls . openstack ( '<STR_LIT>' + cls . OTHER_NAME + '<STR_LIT:U+0020>' <EOL> + cls . NAME ) <EOL> cls . assertOutput ( '<STR_LIT>' , raw_output ) <EOL> raw_output = cls . openstack ( '<STR_LIT>' + cls . OTHER_NAME ) <EOL> cls . assertOutput ( '<STR_LIT>' , raw_output ) <EOL> def test_image_list ( self ) : <EOL> opts = self . get_list_opts ( self . HEADERS ) <EOL> raw_output = self . openstack ( '<STR_LIT>' + opts ) <EOL> self . assertIn ( self . NAME , raw_output ) <EOL> def test_image_show ( self ) : <EOL> opts = self . get_show_opts ( self . FIELDS ) <EOL> raw_output = self . openstack ( '<STR_LIT>' + self . NAME + opts ) <EOL> self . assertEqual ( self . NAME + "<STR_LIT:\n>" , raw_output ) <EOL> def test_image_set ( self ) : <EOL> opts = self . get_show_opts ( [ <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:name>" ] ) <EOL> self . openstack ( '<STR_LIT>' + <EOL> '<STR_LIT>' + self . NAME ) <EOL> raw_output = self . openstack ( '<STR_LIT>' + self . NAME + opts ) <EOL> self . assertEqual ( "<STR_LIT>" + self . NAME + '<STR_LIT:\n>' , raw_output ) <EOL> def test_image_metadata ( self ) : <EOL> opts = self . get_show_opts ( [ "<STR_LIT:name>" , "<STR_LIT>" ] ) <EOL> self . openstack ( '<STR_LIT>' + self . NAME ) <EOL> raw_output = self . openstack ( '<STR_LIT>' + self . NAME + opts ) <EOL> self . assertEqual ( self . NAME + "<STR_LIT>" , raw_output ) </s>
