gdm.test.TestShowLog   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 31
Duplicated Lines 0 %
Metric Value
dl 0
loc 31
rs 10
wmc 7

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setup_method() 0 4 1
A test_show_after_1_indent_2_dedent() 0 9 2
A test_show_after_indent() 0 7 2
A test_show() 0 6 2
1
# pylint: disable=attribute-defined-outside-init
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
3
from unittest.mock import Mock, call
4
5
from gdm import common
6
from gdm.common import _Config
7
8
9
class TestShowConsole:
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
10
11
    def setup_method(self, _):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
12
        _Config.indent_level = 0
13
        _Config.verbosity = 0
14
        self.file = Mock()
15
16
    def test_show(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
17
        common.show("Hello, world!", file=self.file)
18
19
        assert [
20
            call.write("Hello, world!"),
21
            call.write("\n"),
22
        ] == self.file.mock_calls
23
24
    def test_show_after_indent(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
25
        common.indent()
26
        common.show("|\n", file=self.file)
27
28
        assert [
29
            call.write("  |\n"),
30
            call.write("\n"),
31
        ] == self.file.mock_calls
32
33
    def test_show_after_1_indent_2_dedent(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
34
        common.indent()
35
        common.dedent()
36
        common.dedent()
37
        common.show("|\n", file=self.file)
38
39
        assert [
40
            call.write("|\n"),
41
            call.write("\n"),
42
        ] == self.file.mock_calls
43
44
45
class TestShowLog:
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
46
47
    def setup_method(self, _):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
48
        _Config.indent_level = 0
49
        _Config.verbosity = 1
50
        self.log = Mock()
51
52
    def test_show(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
53
        common.show("Hello, world!", log=self.log)
54
55
        assert [
56
            call.info("Hello, world!"),
57
        ] == self.log.mock_calls
58
59
    def test_show_after_indent(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
60
        common.indent()
61
        common.show("|\n", log=self.log)
62
63
        assert [
64
            call.info("|"),
65
        ] == self.log.mock_calls
66
67
    def test_show_after_1_indent_2_dedent(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
68
        common.indent()
69
        common.dedent()
70
        common.dedent()
71
        common.show("|\n", log=self.log)
72
73
        assert [
74
            call.info("|"),
75
        ] == self.log.mock_calls
76
77
78
class TestShowQuiet:
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
79
80
    def setup_method(self, _):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
81
        _Config.indent_level = 0
82
        _Config.verbosity = -1
83
        self.file = Mock()
84
        self.log = Mock()
85
86
    def test_show(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
87
        common.show("Hello, world!", file=self.file, log=self.log)
88
89
        assert [] == self.file.mock_calls
90
        assert [] == self.log.mock_calls
91