Esempio n. 1
0
def test_warningstream_write_nomatch():
    stream = check._WarningStream()
    stream.output = pretend.stub(write=pretend.call_recorder(lambda a: None))

    stream.write("this does not match")

    assert stream.output.write.calls == [pretend.call("this does not match")]
Esempio n. 2
0
def test_warningstream_write_nomatch():
    stream = check._WarningStream()
    stream.output = pretend.stub(write=pretend.call_recorder(lambda a: None))

    stream.write("this does not match")

    assert stream.output.write.calls == [pretend.call("this does not match")]
Esempio n. 3
0
def test_warningstream_write_match():
    stream = check._WarningStream()
    stream.output = pretend.stub(write=pretend.call_recorder(lambda a: None))

    stream.write("<string>:2: (WARNING/2) Title underline too short.")

    assert stream.output.write.calls == [
        pretend.call("line 2: Warning: Title underline too short.\n")
    ]
Esempio n. 4
0
def test_warningstream_write_match():
    stream = check._WarningStream()
    stream.output = pretend.stub(write=pretend.call_recorder(lambda a: None))

    stream.write("<string>:2: (WARNING/2) Title underline too short.")

    assert stream.output.write.calls == [
        pretend.call("line 2: Warning: Title underline too short.\n")
    ]
Esempio n. 5
0
 def setup(self):
     self.stream = check._WarningStream()
     self.stream.output = pretend.stub(
         write=pretend.call_recorder(lambda a: None),
         getvalue=lambda: "result",
     )
Esempio n. 6
0
def test_warningstream_str():
    stream = check._WarningStream()
    stream.output = pretend.stub(getvalue=lambda: "result")

    assert str(stream) == "result"
Esempio n. 7
0
def test_warningstream_str():
    stream = check._WarningStream()
    stream.output = pretend.stub(getvalue=lambda: "result")

    assert str(stream) == "result"