LOG = logging.getLogger(__name__) FIXTURES_MANIFEST = { 'executions': ['execution.json', 'execution_result_has_carriage_return.json'], 'results': [ 'execution_get_default.txt', 'execution_get_detail.txt', 'execution_get_result_by_key.txt', 'execution_result_has_carriage_return.txt', 'execution_get_attributes.txt', 'execution_list_attr_start_timestamp.txt', 'execution_list_empty_response_start_timestamp_attr.txt' ] } FIXTURES = loader.load_fixtures(fixtures_dict=FIXTURES_MANIFEST) EXECUTION = FIXTURES['executions']['execution.json'] HAS_CARRIAGE_RETURN = FIXTURES['executions'][ 'execution_result_has_carriage_return.json'] class TestExecutionResultFormatter(unittest2.TestCase): def __init__(self, *args, **kwargs): super(TestExecutionResultFormatter, self).__init__(*args, **kwargs) self.shell = shell.Shell() self.table = table.SingleRowTable() color.DISABLED = True def setUp(self): self.fd, self.path = tempfile.mkstemp() self._redirect_console(self.path)
from st2client.utils import color LOG = logging.getLogger(__name__) FIXTURES_MANIFEST = { 'executions': ['execution.json', 'execution_result_has_carriage_return.json'], 'results': ['execution_get_default.txt', 'execution_get_detail.txt', 'execution_get_result_by_key.txt', 'execution_result_has_carriage_return.txt', 'execution_get_attributes.txt'] } FIXTURES = loader.load_fixtures(fixtures_dict=FIXTURES_MANIFEST) EXECUTION = FIXTURES['executions']['execution.json'] HAS_CARRIAGE_RETURN = FIXTURES['executions']['execution_result_has_carriage_return.json'] class TestExecutionResultFormatter(unittest2.TestCase): def __init__(self, *args, **kwargs): super(TestExecutionResultFormatter, self).__init__(*args, **kwargs) self.shell = shell.Shell() color.DISABLED = True def setUp(self): self.fd, self.path = tempfile.mkstemp() self._redirect_console(self.path)