Exemplo 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")]
Exemplo 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")]
Exemplo 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")
    ]
Exemplo 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")
    ]
Exemplo 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",
     )
Exemplo n.º 6
0
def test_warningstream_str():
    stream = check._WarningStream()
    stream.output = pretend.stub(getvalue=lambda: "result")

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

    assert str(stream) == "result"