tests.search.test_traversal_strategy   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A TestTargetTraversalStrategy1.test_5ht2bc_sel_group() 0 4 1
A TestTargetTraversalStrategy1.test_mu_or() 0 4 1
A TestTargetTraversalStrategy1.test_5ht2b() 0 4 1
1
import pytest
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
introduced by
Unable to import 'pytest'
Loading history...
2
from chembl_webresource_client.new_client import new_client as Chembl
0 ignored issues
show
introduced by
Unable to import 'chembl_webresource_client.new_client'
Loading history...
3
4
from mandos.model.targets import TargetFactory
5
from mandos.search.chembl.target_traversal_strategy import (
6
    TargetTraversalStrategies,
7
)
8
9
10
class TestTargetTraversalStrategy1:
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
11
    # def test_gabaa(self):
12
    #    target = TargetFactory.find("CHEMBL2109243", Chembl)
13
    #    found = TargetTraversalStrategies.strategy1(Chembl).traverse(target)
14
    #    assert [f.chembl for f in found] == ["CHEMBL2093872"]
15
16
    def test_5ht2b(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...
17
        target = TargetFactory.find("CHEMBL1833", Chembl)
18
        found = TargetTraversalStrategies.strategy1(Chembl).traverse(target)
19
        assert [f.chembl for f in found] == ["CHEMBL2096904"]
20
21
    def test_5ht2bc_sel_group(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...
22
        target = TargetFactory.find("CHEMBL2111466", Chembl)
23
        found = TargetTraversalStrategies.strategy1(Chembl).traverse(target)
24
        assert [f.chembl for f in found] == ["CHEMBL2096904"]
25
26
    def test_mu_or(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...
27
        target = TargetFactory.find("CHEMBL233", Chembl)
28
        found = TargetTraversalStrategies.strategy1(Chembl).traverse(target)
29
        assert [f.chembl for f in found] == ["CHEMBL2095181"]
30
31
32
if __name__ == "__main__":
33
    pytest.main()
34