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