Passed
Pull Request — master (#3)
by Yang
04:58
created

UT_LORISCandidates.test_CNBP_PSCID()   A

Complexity

Conditions 1

Size

Total Lines 13
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 12
nop 0
dl 0
loc 13
rs 9.8
c 0
b 0
f 0
1
import logging
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...
Unused Code introduced by
The import logging seems to be unused.
Loading history...
2
from LORIS.candidates import LORIS_candidates
0 ignored issues
show
introduced by
Unable to import 'LORIS.candidates'
Loading history...
3
from LORIS.query import LORIS_query
0 ignored issues
show
introduced by
Unable to import 'LORIS.query'
Loading history...
Unused Code introduced by
Unused LORIS_query imported from LORIS.query
Loading history...
4
import unittest
0 ignored issues
show
introduced by
standard import "import unittest" should be placed before "from LORIS.candidates import LORIS_candidates"
Loading history...
5
6
class UT_LORISCandidates(unittest.TestCase):
0 ignored issues
show
Coding Style Naming introduced by
The name UT_LORISCandidates 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...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
7
8
    """
9
    def test_create_subject():
10
        logger = logging.getLogger('UT_LORIS_create_subject_check')
11
        response_success, token = LORIS_query.login()
12
13
        if not response_success:
14
            raise ConnectionError
15
16
        PSCID = "CNBP8881234"
17
18
        success, DCCID = LORIS_candidates.createCandidateCNBP(token, PSCID)
19
20
        LORIS_candidates.deleteCandidateCNBP(token, DCCID, PSCID)
21
        logger.info("UT_LORIS_create_subject_check PASSED")
22
23
24
    def test_delete_subjects():
25
        logger = logging.getLogger('UT_LORIS_create_subject_check')
26
        response_success, token = LORIS_query.login()
27
28
        DCCID = "881417"
29
        PSCID = "CNBP9991234"
30
        # one time runnable code:
31
        LORIS_candidates.deleteCandidateCNBP(token, DCCID, PSCID)
32
        logger.info("UT_LORIS_create_subject_check PASSED")
33
    """
34
35
    @staticmethod
36
    def test_check_projectID():
0 ignored issues
show
Coding Style Naming introduced by
The name test_check_projectID does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-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 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...
37
        ProjectID = "GL01"
0 ignored issues
show
Coding Style Naming introduced by
The name ProjectID does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-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...
38
        assert LORIS_candidates.check_projectID_compliance(ProjectID)
39
40
        ProjectID = "GL09"
0 ignored issues
show
Coding Style Naming introduced by
The name ProjectID does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-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...
41
        assert not LORIS_candidates.check_projectID_compliance(ProjectID)
42
43
        ProjectID = "AL01"
0 ignored issues
show
Coding Style Naming introduced by
The name ProjectID does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-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...
44
        assert not LORIS_candidates.check_projectID_compliance(ProjectID)
45
46
        ProjectID = "AB01"
0 ignored issues
show
Coding Style Naming introduced by
The name ProjectID does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-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...
47
        assert LORIS_candidates.check_projectID_compliance(ProjectID)
48
49
    @staticmethod
50
    def test_CNBP_PSCID():
0 ignored issues
show
Coding Style Naming introduced by
The name test_CNBP_PSCID does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-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 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...
51
        PSCID = "VXS" + "GL01"  + "0001"
0 ignored issues
show
Coding Style Naming introduced by
The name PSCID does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-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...
52
        PSCID1 = "VXa" + "GL01" + "0001"
0 ignored issues
show
Coding Style Naming introduced by
The name PSCID1 does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-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...
53
        PSCID2 = "VXS" + "GL02" + "0001"
0 ignored issues
show
Coding Style Naming introduced by
The name PSCID2 does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-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...
54
        PSCID3 = "VXS" + "GL01" + "0001"
0 ignored issues
show
Coding Style Naming introduced by
The name PSCID3 does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-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...
55
        PSCID4 = "VXS" + "GL01" + "0009"
0 ignored issues
show
Coding Style Naming introduced by
The name PSCID4 does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-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...
56
57
        assert(LORIS_candidates.check_PSCID_compliance(PSCID))
0 ignored issues
show
Unused Code Coding Style introduced by
There is an unnecessary parenthesis after assert.
Loading history...
58
        assert not LORIS_candidates.check_PSCID_compliance(PSCID1)
59
        assert not LORIS_candidates.check_PSCID_compliance(PSCID2)
60
        assert LORIS_candidates.check_PSCID_compliance(PSCID3)
61
        assert LORIS_candidates.check_PSCID_compliance(PSCID4)
62
63
if __name__ == "__main__":
64
    UT_LORISCandidates.test_CNBP_PSCID()
0 ignored issues
show
Coding Style introduced by
Final newline missing
Loading history...