Esempio 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'])
Esempio 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'])
Esempio 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"])
Esempio 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"])