1 | import pytest |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
2 | from pocketutils.core.dot_dict import NestedDotDict |
||
0 ignored issues
–
show
|
|||
3 | |||
4 | from mandos.chembl_api import ChemblApi, ChemblEntrypoint, ChemblFilterQuery |
||
5 | |||
6 | |||
7 | class TestChemblApi: |
||
0 ignored issues
–
show
|
|||
8 | def test_mocked(self): |
||
0 ignored issues
–
show
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;
![]() |
|||
9 | api = ChemblApi.mock({"target": ChemblEntrypoint.mock({"DAT": {"x": ""}})}) |
||
10 | dotdict = NestedDotDict({"x": ""}) |
||
11 | assert api.target is not None |
||
12 | assert api.target.get("DAT") is not None |
||
13 | assert isinstance(api.target.get("DAT"), NestedDotDict) |
||
14 | assert api.target.get("DAT") == dotdict |
||
15 | with pytest.raises(KeyError): |
||
16 | assert api.target.get("fasw") |
||
17 | assert isinstance(api.target.filter(), ChemblFilterQuery) |
||
18 | assert isinstance(api.target.filter().only([]), ChemblFilterQuery) |
||
19 | z = list(api.target.filter().only([])) |
||
0 ignored issues
–
show
Variable name "z" 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. ![]() |
|||
20 | assert z == [dotdict] |
||
21 | |||
22 | |||
23 | if __name__ == "__main__": |
||
24 | pytest.main() |
||
25 |