#NEWLINE# def test_port_by_address_invalid_address_format( self ) : #NEWLINE# #INDENT# obj_utils . create_test_port ( self . context , node_id = self . node . id ) #NEWLINE# invalid_address = 'invalid-mac-format' #NEWLINE# response = self . get_json ( ( '/ports?address=%s' % invalid_address ) , expect_errors = True ) #NEWLINE# self . assertEqual ( http_client . BAD_REQUEST , response . status_int ) #NEWLINE# self . assertEqual ( 'application/json' , response . content_type ) #NEWLINE# self . assertIn ( invalid_address , response . json [ 'error_message' ] )