wpiformat/wpiformat/test/test_tasktest.py
def run(self, output_type):
        """Runs the task on each input list element, then compares the resulting
        output against the corresponding output list element.

        output_type == FILE: output list contains file contents
        output_type == STDOUT: output list contains stdout contents

        Keyword Arguments:
        output_type -- the type of output stored in the output list
        """
        assert len(self.inputs) == len(self.outputs)

        config_file = Config(os.path.abspath(os.getcwd()), ".styleguide")

        for i in range(len(self.inputs)):
            if self.task.should_process_file(config_file, self.inputs[i][0]):
                print("Running test {}...".format(i))

                if output_type == OutputType.FILE:
                    output, success = self.task.run_pipeline(
                        config_file, self.inputs[i][0], self.inputs[i][1])
                elif output_type == OutputType.STDOUT:
                    saved_stdout = sys.stdout
                    sys.stdout = io.StringIO()
                    _output, success = self.task.run_pipeline(
                        config_file, self.inputs[i][0], self.inputs[i][1])
                    sys.stdout.seek(0)
                    output = sys.stdout.read()
                    sys.stdout = saved_stdout
            else:
                output = self.inputs[i][1]
                success = True

            assert output == self.outputs[i][0]
            assert success == self.outputs[i][1]
Runs the task on each input list element, then compares the resulting
        output against the corresponding output list element.

        output_type == FILE: output list contains file contents
        output_type == STDOUT: output list contains stdout contents

        Keyword Arguments:
        output_type -- the type of output stored in the output list
        
Runs the task on each input list element, then compares the resulting
output against the corresponding output list element.

output_type == FILE: output list contains file contents
output_type == STDOUT: output list contains stdout contents

Keyword Arguments:
output_type -- the type of output stored in the output list
Runs the task on each input list element then compares the resulting output against the corresponding output list element . output_type == FILE : output list contains file contents output_type == STDOUT : output list contains stdout contents Keyword Arguments : output_type -- the type of output stored in the output list
def run(self, output_type):
        assert len(self.inputs) == len(self.outputs)
        config_file = Config(os.path.abspath(os.getcwd()), ".styleguide")
        for i in range(len(self.inputs)):
            if self.task.should_process_file(config_file, self.inputs[i][0]):
                print("Running test {}...".format(i))
                if output_type == OutputType.FILE:
                    output, success = self.task.run_pipeline(
                        config_file, self.inputs[i][0], self.inputs[i][1])
                elif output_type == OutputType.STDOUT:
                    saved_stdout = sys.stdout
                    sys.stdout = io.StringIO()
                    _output, success = self.task.run_pipeline(
                        config_file, self.inputs[i][0], self.inputs[i][1])
                    sys.stdout.seek(0)
                    output = sys.stdout.read()
                    sys.stdout = saved_stdout
            else:
                output = self.inputs[i][1]
                success = True
            assert output == self.outputs[i][0]
            assert success == self.outputs[i][1]
def run ( self , output_type ) : assert len ( self . inputs ) == len ( self . outputs ) config_file = Config ( os . path . abspath ( os . getcwd ( ) ) , ".styleguide" ) for i in range ( len ( self . inputs ) ) : if self . task . should_process_file ( config_file , self . inputs [ i ] [ 0 ] ) : print ( "Running test {}..." . format ( i ) ) if output_type == OutputType . FILE : output , success = self . task . run_pipeline ( config_file , self . inputs [ i ] [ 0 ] , self . inputs [ i ] [ 1 ] ) elif output_type == OutputType . STDOUT : saved_stdout = sys . stdout sys . stdout = io . StringIO ( ) _output , success = self . task . run_pipeline ( config_file , self . inputs [ i ] [ 0 ] , self . inputs [ i ] [ 1 ] ) sys . stdout . seek ( 0 ) output = sys . stdout . read ( ) sys . stdout = saved_stdout else : output = self . inputs [ i ] [ 1 ] success = True assert output == self . outputs [ i ] [ 0 ] assert success == self . outputs [ i ] [ 1 ]
Runs the task on each input list element, then compares the resulting
output against the corresponding output list element.
Runs the task on each input list element then compares the resulting output against the corresponding output list element .
"""Runs the task on each input list element, then compares the resulting
        output against the corresponding output list element.

        output_type == FILE: output list contains file contents
        output_type == STDOUT: output list contains stdout contents

        Keyword Arguments:
        output_type -- the type of output stored in the output list
        """
self
output_type