Passed
Push — master ( 9e6838...cf264a )
by Yang
27s
created

test_updateLocalTimepoint()   A

Complexity

Conditions 3

Size

Total Lines 29
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 29
rs 9.7
c 0
b 0
f 0
cc 3
nop 0
1
from LORIS.query import login
0 ignored issues
show
Coding Style Naming introduced by
The name test_Integration 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...
introduced by
Unable to import 'LORIS.query'
Loading history...
2
from LocalDB.create_CNBP import create_localDB_CNBP
0 ignored issues
show
Bug introduced by
The name create_CNBP does not seem to exist in module LocalDB.
Loading history...
introduced by
Unable to import 'LocalDB.create_CNBP'
Loading history...
3
from LocalDB.schema import CNBP_schema_keyfield, CNBP_schema_table_name
0 ignored issues
show
Bug introduced by
The name schema does not seem to exist in module LocalDB.
Loading history...
introduced by
Unable to import 'LocalDB.schema'
Loading history...
4
from LocalDB.query import create_entry, update_entry
0 ignored issues
show
Bug introduced by
The name query does not seem to exist in module LocalDB.
Loading history...
introduced by
Unable to import 'LocalDB.query'
Loading history...
5
from Integration.Intermediate_LORIS_LocalDB import findTimePointUpdateDatabase
0 ignored issues
show
introduced by
Unable to import 'Integration.Intermediate_LORIS_LocalDB'
Loading history...
6
7
8
def test_updateLocalTimepoint():
0 ignored issues
show
Coding Style Naming introduced by
The name test_updateLocalTimepoint 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
    import os
10
    database_path = "Test.sqlite"
11
    DCCID = 642461
0 ignored issues
show
Coding Style Naming introduced by
The name DCCID 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...
12
    table_name = CNBP_schema_table_name
13
14
    # Remove database if previously existed.
15
    if os.path.exists(database_path):
16
        os.remove(database_path)
17
18
    # Create Database
19
    create_localDB_CNBP(database_path)
20
21
    # Get login token:
22
    success, token = login()
23
24
    # Create the entry with the right PSCID with proper DCCID on dev.cnbp.ca
25
    create_entry(database_path, table_name, CNBP_schema_keyfield, 9999999999)
26
27
    # Update above entry with the right mock PSCID.
28
    update_entry(database_path, table_name, CNBP_schema_keyfield, 9999999999, "DCCID", DCCID, )
29
30
    # Now, the big guy.
31
    success, reason = findTimePointUpdateDatabase(token, DCCID, database_path, table_name)
0 ignored issues
show
Unused Code introduced by
The variable reason seems to be unused.
Loading history...
32
33
    # Clean up database.
34
    os.remove(database_path)
35
36
    assert success
0 ignored issues
show
Coding Style introduced by
Final newline missing
Loading history...