def test_print_report_without_filtering(self): process_stack_util = Mock() process_filter = Mock() printer = Mock() process_filter.filter_processes = Mock(return_value=self.processes) reporter = CpuProcessStackUtilReporter(process_stack_util, process_filter, printer, self.options) reporter.print_report(123) printer.assert_called_with("123\t1000\t1\t136\tprocess_1")
def test_print_report_header(self): process_stack_util = Mock() process_filter = Mock() printer = Mock() process_filter.filter_processes = Mock(return_value=self.processes) reporter = CpuProcessStackUtilReporter(process_stack_util, process_filter, printer, self.options) reporter.print_report(123, " ", " ") printer.assert_any_call("Timestamp UID\tPID\tStkSize\tCommand")
def test_print_report_with_user_name(self): self.options.show_process_user = '******' process_stack_util = Mock() process_filter = Mock() printer = Mock() process_filter.filter_processes = Mock(return_value=self.processes) reporter = CpuProcessStackUtilReporter(process_stack_util, process_filter, printer, self.options) reporter.print_report(123) printer.assert_called_with("123\tpcp\t1\t136\tprocess_1")