Passed
Push — main ( d2739b...2ca903 )
by Douglas
02:55 queued 01:10
created

TestSysTools.test_get_env_info()   A

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
import pytest
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
introduced by
Unable to import 'pytest'
Loading history...
2
3
from pocketutils.tools.sys_tools import SystemTools
4
5
6
class TestSysTools:
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
7
    def test_add_signals(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
8
        pass
9
10
    def test_get_env_info(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
        data = SystemTools.get_env_info(include_insecure=True)
12
        assert len(data) > 20
13
        assert "pid" in data
14
        assert "disk_used" in data
15
        assert "hostname" in data
16
        assert "locale" in data
17
18
    def test_list_imports(self):
0 ignored issues
show
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...
introduced by
Missing function or method docstring
Loading history...
19
        data = SystemTools.list_package_versions()
20
        assert len(data) > 5
21
        assert "orjson" in data
22
        assert data["orjson"].startswith("3.")  # change when updated
23
24
25
if __name__ == "__main__":
26
    pytest.main()
27