<s> import re <EOL> import six <EOL> from nailgun . settings import settings <EOL> from nailgun . test import base <EOL> class TestSettings ( base . BaseTestCase ) : <EOL> def test_log_format_remote_openstack ( self ) : <EOL> syslog_w_app = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> syslog = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> openstack_format = filter ( <EOL> lambda log : log [ '<STR_LIT>' ] == '<STR_LIT>' , <EOL> settings . LOG_FORMATS ) [ <NUM_LIT:0> ] <EOL> regexp = re . compile ( openstack_format [ '<STR_LIT>' ] ) <EOL> syslog_w_app_re = regexp . match ( syslog_w_app ) <EOL> syslog_re = regexp . match ( syslog ) <EOL> syslog_result = { <EOL> '<STR_LIT:text>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:date>' : '<STR_LIT>' } <EOL> syslog_w_app_result = { <EOL> '<STR_LIT:text>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:info>' , <EOL> '<STR_LIT:date>' : '<STR_LIT>' } <EOL> for group , value in six . iteritems ( syslog_result ) : <EOL> self . assertEqual ( syslog_re . group ( group ) , <EOL> syslog_result [ group ] ) <EOL> for group , value in six . iteritems ( syslog_w_app_result ) : <EOL> self . assertEqual ( syslog_w_app_re . group ( group ) , <EOL> syslog_w_app_result [ group ] ) </s>
