Ejemplo n.º 1
0
    def wait_status(self):

        self.print_start()

        # Start and wait for the process
        self.proc_.communicate()

        with codecs.open('{}/log_stdout.log'.format(self.path_),
                         encoding='utf-8',
                         errors='replace') as log_stdout:
            self.output_.append(log_stdout.read())

        with codecs.open('{}/log_stderr.log'.format(self.path_),
                         encoding='utf-8',
                         errors='replace') as log_stderr:
            self.output_.append(log_stderr.read())

        if self.proc_.returncode == 0:
            print pretty.PASS_INLINE()
        else:
            print pretty.FAIL_INLINE()
            print pretty.INFO("Process stdout")
            print pretty.DATA(self.output_[0])
            print pretty.INFO("Process stderr")
            print pretty.DATA(self.output_[1])

        return self.proc_.returncode
Ejemplo n.º 2
0
    def wait_status(self):

        self.print_start()

        # Start and wait for the process
        self.output_ = self.proc_.communicate()

        if self.proc_.returncode == 0:
            print pretty.PASS_INLINE()
        else:
            print pretty.FAIL_INLINE()
            print pretty.INFO("Process stdout")
            print pretty.DATA(self.output_[0])
            print pretty.INFO("Process stderr")
            print pretty.DATA(self.output_[1])

        return self.proc_.returncode