Passed
Push — main ( ddff4b...7b3fbc )
by Douglas
04:33
created

tests.model.test_hits   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A TestHits.test() 0 6 1
1
from dataclasses import dataclass
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
3
import pytest
0 ignored issues
show
introduced by
Unable to import 'pytest'
Loading history...
4
5
from mandos.model.hits import HitFrame, AbstractHit, Pair, Triple
0 ignored issues
show
Unused Code introduced by
Unused Triple imported from mandos.model.hits
Loading history...
Unused Code introduced by
Unused Pair imported from mandos.model.hits
Loading history...
Unused Code introduced by
Unused HitFrame imported from mandos.model.hits
Loading history...
6
7
8
@dataclass(frozen=True, order=True, repr=True)
9
class _SimpleHit(AbstractHit):
10
    """"""
11
12
13
class TestHits:
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
14
    def test(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
15
        hit = AbstractHit()
0 ignored issues
show
Unused Code introduced by
The variable hit seems to be unused.
Loading history...
16
17
        mp = Mappings.from_resource("@targets_neuro.regexes")
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable Mappings does not seem to be defined.
Loading history...
Coding Style Naming introduced by
Variable name "mp" 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...
Comprehensibility Best Practice introduced by
Undefined variable 'Mappings'
Loading history...
18
        assert mp.get("Dopamine D3 receptor") == ["Dopamine 2/3/4 receptor", "D_{2/3/4}"]
19
        assert mp.get("Cytochrome P450 2A6") == ["Cytochrome P450 2", "CYP2"]
20
21
22
if __name__ == "__main__":
23
    pytest.main()
24