Passed
Push — main ( 4e4203...cdf0f7 )
by Douglas
01:39
created

tests.test_cli   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A TestCli.test_help() 0 5 1
A TestCli.test_spec_help() 0 6 2
1
import pytest
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
introduced by
Unable to import 'pytest'
Loading history...
2
from typer.testing import CliRunner
0 ignored issues
show
introduced by
Unable to import 'typer.testing'
Loading history...
3
4
from mandos.cli import Commands, cli
0 ignored issues
show
Unused Code introduced by
Unused Commands imported from mandos.cli
Loading history...
5
6
from . import get_test_resource
0 ignored issues
show
Unused Code introduced by
The import get_test_resource seems to be unused.
Loading history...
7
8
9
class TestCli:
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
10
    def test_help(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...
11
        runner = CliRunner()
12
        result = runner.invoke(cli, ["--help"])
13
        assert result.exit_code == 0
14
        assert "Usage" in result.stdout
15
16
    def test_spec_help(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
        runner = CliRunner()
18
        result = runner.invoke(cli, ["chembl:atc", "--help"])
19
        if result.exception is not None:
20
            raise result.exception
21
        assert "--verbose" in result.stdout
22
23
24
if __name__ == "__main__":
25
    pytest.main()
26