def test_put_non_string(self): base = self._makeOne([]) base.put(0) self._output.seek(0) out = self._output.read() self.assertEqual(out, "0\n")
def test_put_no_newline(self): base = self._makeOne([]) base.put("hello world", newline=False) self._output.seek(0) out = self._output.read() self.assertEqual(out, "hello world")
def test_put(self): base = self._makeOne([]) base.put("hello world") self._output.seek(0) out = self._output.read() self.assertEqual(out, "hello world\n")
def test_put_options(self): base = self._makeOne([]) base.options["quiet"] = True base.put("hello world") self._output.seek(0) out = self._output.read() self.assertEqual(out, "") base.options["quiet"] = False base.put("hello world") self._output.seek(0) out = self._output.read() self.assertEqual(out, "hello world\n")