Exemplo n.º 1
0
    def test_write(self):
        r = HttpResponseBase()
        self.assertIs(r.writable(), False)

        with self.assertRaisesMessage(OSError, 'This HttpResponseBase instance is not writable'):
            r.write('asdf')
        with self.assertRaisesMessage(OSError, 'This HttpResponseBase instance is not writable'):
            r.writelines(['asdf\n', 'qwer\n'])
Exemplo n.º 2
0
    def test_write(self):
        r = HttpResponseBase()
        self.assertIs(r.writable(), False)

        with self.assertRaisesMessage(IOError, 'This HttpResponseBase instance is not writable'):
            r.write('asdf')
        with self.assertRaisesMessage(IOError, 'This HttpResponseBase instance is not writable'):
            r.writelines(['asdf\n', 'qwer\n'])
Exemplo n.º 3
0
    def test_write(self):
        r = HttpResponseBase()
        self.assertIs(r.writable(), False)

        with self.assertRaisesMessage(IOError, "This HttpResponseBase instance is not writable"):
            r.write("asdf")
        with self.assertRaisesMessage(IOError, "This HttpResponseBase instance is not writable"):
            r.writelines(["asdf\n", "qwer\n"])
Exemplo n.º 4
0
    def test_write(self):
        r = HttpResponseBase()
        self.assertIs(r.writable(), False)

        with self.assertRaisesMessage(
                OSError, "This HttpResponseBase instance is not writable"):
            r.write("asdf")
        with self.assertRaisesMessage(
                OSError, "This HttpResponseBase instance is not writable"):
            r.writelines(["asdf\n", "qwer\n"])