Exemplo n.º 1
0
    def test_show_after_1_indent_2_dedent(self):
        common.indent()
        common.dedent()
        common.dedent()
        common.show("|\n", log=self.log, color=None)

        assert [call.info("|")] == self.log.mock_calls
Exemplo n.º 2
0
    def test_show_after_1_indent_2_dedent(self):
        common.indent()
        common.dedent()
        common.dedent()
        common.show("|\n", file=self.file, color=None)

        assert [call.write("|\n"), call.write("\n")] == self.file.mock_calls
Exemplo n.º 3
0
    def test_show(self):
        common.show("Hello, world!", file=self.file, color=None)

        assert [
            call.write("Hello, world!"),
            call.write("\n"),
        ] == self.file.mock_calls
Exemplo n.º 4
0
 def it_requries_color_with_messages():
     with expect.raises(AssertionError):
         common.show("Hello, world!", 'foobar')
Exemplo n.º 5
0
    def test_show(self):
        common.show("Hello, world!", file=self.file, log=self.log, color=None)

        assert [] == self.file.mock_calls
        assert [] == self.log.mock_calls
Exemplo n.º 6
0
    def test_show_errors(self):
        common.show("Oops", color='error', log=self.log)

        expect(self.log.mock_calls) == [call.error("Oops")]
Exemplo n.º 7
0
    def test_show(self):
        common.show("Hello, world!", log=self.log, color=None)

        assert [call.info("Hello, world!")] == self.log.mock_calls