Пример #1
0
    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")
Пример #2
0
    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")
Пример #3
0
    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")
Пример #4
0
    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")