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.model.settings import Settings |
||
5 | |||
6 | from .. import get_test_resource |
||
7 | |||
8 | |||
9 | class TestSettings: |
||
0 ignored issues
–
show
|
|||
10 | def test_settings(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;
![]() |
|||
11 | toml = NestedDotDict.read_toml(get_test_resource("settings.toml")) |
||
12 | x = Settings.load(toml) |
||
0 ignored issues
–
show
Variable name "x" 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. ![]() |
|||
13 | assert x.taxon == 1111 |
||
14 | assert x.min_pchembl == 15 |
||
15 | assert x.min_confidence_score == 2 |
||
16 | assert x.min_phase == 0 |
||
17 | assert str(x.chembl_cache_path) == "~" |
||
18 | assert x.n_retries == 100 |
||
19 | assert not x.fast_save |
||
20 | assert x.timeout_sec == 0 |
||
21 | |||
22 | def test_empty(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;
![]() |
|||
23 | toml = NestedDotDict.read_toml(get_test_resource("settings-empty.toml")) |
||
24 | x = Settings.load(toml) |
||
0 ignored issues
–
show
Variable name "x" 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. ![]() |
|||
25 | assert x.min_phase == 3 |
||
26 | |||
27 | |||
28 | if __name__ == "__main__": |
||
29 | pytest.main() |
||
30 |