Completed
Pull Request — master (#3)
by Yang
03:41
created

Python.LORIS.test_dotenv   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 24
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A UT_envCheck.test_env() 0 26 2
1
from dotenv import load_dotenv
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
import unittest
0 ignored issues
show
introduced by
standard import "import unittest" should be placed before "from dotenv import load_dotenv"
Loading history...
3
import os
0 ignored issues
show
introduced by
standard import "import os" should be placed before "from dotenv import load_dotenv"
Loading history...
4
5
class UT_envCheck(unittest.TestCase):
0 ignored issues
show
Coding Style Naming introduced by
The name UT_envCheck does not conform to the class naming conventions ([A-Z_][a-zA-Z0-9]+$).

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.

Loading history...
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
6
7
    @staticmethod
8
    def test_env():
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
9
        success= load_dotenv()
0 ignored issues
show
Coding Style introduced by
Exactly one space required before assignment
Loading history...
10
        if not success:
11
            raise ImportError("Credential .env NOT FOUND! Please ensure .env is set with all the necessary credentials!")
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (121/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
12
13
14
        assert os.getenv("LORISurl") is not None
15
        assert os.getenv("LORISusername") is not None
16
        assert os.getenv("LORISpassword") is not None
17
18
        assert os.getenv("timepoint_prefix") is not None
19
        assert os.getenv("projectID_dictionary") is not None
20
        assert os.getenv("LocalDatabase") is not None
21
22
        assert os.getenv("OrthancURL") is not None
23
24
        assert os.getenv("ProxyIP") is not None
25
        assert os.getenv("ProxyUsername") is not None
26
        assert os.getenv("ProxyPassword") is not None
27
28
        assert os.getenv("LORISHostPassword") is not None
29
        assert os.getenv("LORISHostUsername") is not None
30
        assert os.getenv("LORISHostIP") is not None
31
32
        assert os.getenv("DeletionScript") is not None
33