def test__write_Should_CallExpected_When_NoTtyButForce(self, print_patch, stderr_patch, *patches): stderr_patch.isatty.return_value = False term = Terminal(13, create=True) term.current = 0 term.write(3, force=True) self.assertEqual(len(print_patch.mock_calls), 2) self.assertEqual(term.current, 1)
def test__write_Should_CallExpected_When_Notty(self, print_patch, stderr_patch, *patches): stderr_patch.isatty.return_value = False term = Terminal(13, create=True) term.current = 0 term.write(3) print_patch.assert_not_called() self.assertEqual(term.current, 0)