Passed
Pull Request — master (#2)
by Yang
02:09
created

Python.LORIS.test_LORIS_Query   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 14
eloc 34
dl 0
loc 44
rs 10
c 0
b 0
f 0

4 Functions

Rating   Name   Duplication   Size   Complexity  
A test_LORIS_login() 0 4 2
A test_checkPSCIDExist() 0 8 4
A test_checkDCCIDExist() 0 8 4
A test_LORIS_get() 0 9 4
1
import logging
0 ignored issues
show
Coding Style Naming introduced by
The name test_LORIS_Query does not conform to the module naming conventions ((([a-z_][a-z0-9_]*)|([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 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 sys
3
from LORIS.query import login, getCNBP
0 ignored issues
show
introduced by
Unable to import 'LORIS.query'
Loading history...
4
from LORIS.candidates import checkDCCIDExist, checkPSCIDExist
0 ignored issues
show
introduced by
Unable to import 'LORIS.candidates'
Loading history...
5
6
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
7
8
def test_LORIS_login():
0 ignored issues
show
Coding Style Naming introduced by
The name test_LORIS_login does not conform to the function 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 function 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
    logger = logging.getLogger('UT_LORIS_login')
0 ignored issues
show
Unused Code introduced by
The variable logger seems to be unused.
Loading history...
10
    response_success, token = login()
0 ignored issues
show
Unused Code introduced by
The variable token seems to be unused.
Loading history...
11
    assert response_success
12
    #assert len(token) == 256 #token should always be 256 char long
13
14
def test_LORIS_get():
0 ignored issues
show
Coding Style Naming introduced by
The name test_LORIS_get does not conform to the function 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 function 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...
15
    logger = logging.getLogger('UT_LORIS_get')
0 ignored issues
show
Unused Code introduced by
The variable logger seems to be unused.
Loading history...
16
    response_success, token = login()
17
    assert response_success
18
    #assert len(token) == 256  # token should always be 256 char long
19
    response_success, json = getCNBP(token, "projects")
0 ignored issues
show
Unused Code introduced by
The variable json seems to be unused.
Loading history...
20
    assert response_success
21
    response_success, json = getCNBP(token, "candidates")
22
    assert response_success
23
24
def test_checkPSCIDExist():
0 ignored issues
show
Coding Style Naming introduced by
The name test_checkPSCIDExist does not conform to the function 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 function 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...
25
    logger = logging.getLogger('UT_LORIS_PSCID_check')
0 ignored issues
show
Unused Code introduced by
The variable logger seems to be unused.
Loading history...
26
    response_success, token = login()
27
    assert response_success
28
    #assert len(token) == 256  # token should always be 256 char long
29
    response_success, exist = checkPSCIDExist(token, "CNBP0010001")
30
    assert response_success
31
    assert exist
32
33
def test_checkDCCIDExist():
0 ignored issues
show
Coding Style Naming introduced by
The name test_checkDCCIDExist does not conform to the function 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 function 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...
34
    logger = logging.getLogger('UT_LORIS_DCCID_check')
0 ignored issues
show
Unused Code introduced by
The variable logger seems to be unused.
Loading history...
35
    response_success, token = login()
36
    assert response_success
37
    #assert len(token) == 256  # token should always be 256 char long
38
    response_success, exist = checkDCCIDExist(token, 272264)
39
    assert response_success
40
    assert exist
41
42
if __name__ == '__main__':
43
    test_checkPSCIDExist()
44