Passed
Push — main ( 6d4817...ffd182 )
by Douglas
01:37
created

pocketutils.misc.mocks   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 28
dl 0
loc 42
rs 10
c 0
b 0
f 0
wmc 11

11 Methods

Rating   Name   Duplication   Size   Complexity  
A MockCallable.__init__() 0 2 1
A Mammal.__hash__() 0 2 1
A MockWritable.flush() 0 2 1
A MockWritable.__init__() 0 2 1
A Mammal.__init__() 0 2 1
A Mammal.__repr__() 0 2 1
A MockCallable.__call__() 0 2 1
A MockWritable.close() 0 2 1
A Mammal.__eq_() 0 2 1
A MockWritable.write() 0 2 1
A Mammal.__str__() 0 2 1
1
class Mammal:
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
introduced by
Missing class docstring
Loading history...
2
    def __init__(self, species):
3
        self.species = species
4
5
    def __eq_(self, o):
0 ignored issues
show
Coding Style Naming introduced by
Argument name "o" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
6
        return hash(o.species) == hash(self.species)
7
8
    def __hash__(self):
9
        return hash(self.species)
10
11
    def __repr__(self):
12
        return "<" + self.species + ">|"
13
14
    def __str__(self):
15
        return "<" + self.species + ">|"
16
17
18
class MockWritable:
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
19
    def __init__(self):
20
        self.data = None
21
22
    def write(self, data):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
23
        self.data = "write:" + data
24
25
    def flush(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
26
        self.data += "flush"
27
28
    def close(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
29
        self.data += "close"
30
31
32
class MockCallable:
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
33
    def __init__(self):
34
        self.data = None
35
36
    def __call__(self, data):
37
        self.data = "call:" + data
38
39
40
class WritableCallable(MockWritable, MockCallable):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
41
    pass
42