Passed
Pull Request — master (#3)
by Yang
05:59
created

test_CreateSubjectCheckExist()   B

Complexity

Conditions 8

Size

Total Lines 49
Code Lines 31

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 31
dl 0
loc 49
rs 7.2693
c 0
b 0
f 0
cc 8
nop 0
1
import sqlite3
0 ignored issues
show
Coding Style Naming introduced by
The name test_LocalDBQuery 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
from pathlib import Path
3
import logging
4
import os
5
import sys
6
from LocalDB.query import LocalDB_query
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...
7
from LocalDB.create_CNBP import LocalDB_createCNBP
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...
8
from dotenv import load_dotenv
9
import unittest
0 ignored issues
show
introduced by
standard import "import unittest" should be placed before "from LocalDB.query import LocalDB_query"
Loading history...
10
from LocalDB.schema import CNBP_blueprint
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...
introduced by
Imports from package LocalDB are not grouped
Loading history...
11
12
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
13
14
15
class UT_LocalDBCreate(unittest.TestCase):
0 ignored issues
show
Coding Style Naming introduced by
The name UT_LocalDBCreate 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...
16
17
    @staticmethod
18
    def test_CreateSubject():
0 ignored issues
show
Coding Style Naming introduced by
The name test_CreateSubject 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...
19
        logger = logging.getLogger('UT_CreateSubject')
20
        PathString = "TestCNBPQuery.sqlite"
0 ignored issues
show
Coding Style Naming introduced by
The name PathString 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...
21
22
        # if SQL already exist, quit script.
23
        SQLPath = Path(PathString)
0 ignored issues
show
Coding Style Naming introduced by
The name SQLPath 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...
24
25
        # check if path is a file and exist.
26
        if SQLPath.is_file():
27
            logger.info('Test SQLite database file already exist. Gonna mess with it!')
28
            ''''Delete current database! During testing only'''
0 ignored issues
show
Unused Code introduced by
This string statement has no effect and could be removed.
Loading history...
29
            os.remove(PathString)
30
31
        # Create the database
32
        assert LocalDB_createCNBP.database(PathString)
33
        logger.info('Test SQLite database successfully created. Gonna mess with it!')
34
35
        LocalDB_query.create_entry(PathString, CNBP_blueprint.table_name, CNBP_blueprint.keyfield, 291033)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (106/100).

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

Loading history...
36
        logger.info('Test SQLite database successfully inserted with mock records. Gonna check!')
37
38
        # Populate the table with some fake records.
39
        ConnectedDatabase = sqlite3.connect(PathString)
0 ignored issues
show
Coding Style Naming introduced by
The name ConnectedDatabase 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...
40
        c = ConnectedDatabase.cursor()
0 ignored issues
show
Coding Style Naming introduced by
The name c 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
        c.execute(
42
            'SELECT * FROM {tablename} WHERE {columnname}="{columnvalue}"'.
43
                format(tablename=CNBP_blueprint.table_name, columnname=CNBP_blueprint.keyfield,columnvalue=291033))
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation (remove 4 spaces).
Loading history...
Coding Style introduced by
This line is too long as per the coding-style (115/100).

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

Loading history...
Coding Style introduced by
Exactly one space required after comma
Loading history...
44
        ResultRows = c.fetchall()
0 ignored issues
show
Coding Style Naming introduced by
The name ResultRows 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...
45
46
        assert len(ResultRows) > 0
0 ignored issues
show
Unused Code introduced by
Do not use len(SEQUENCE) as condition value
Loading history...
47
48
        # Closing the connection to the database file
49
        ConnectedDatabase.close()
50
51
        # Remove test data base created
52
        os.remove(PathString)
53
54
        return True
55
56
    @staticmethod
57
    def test_CheckSubjectExist():
0 ignored issues
show
Coding Style Naming introduced by
The name test_CheckSubjectExist 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...
58
        logger = logging.getLogger('UT_CheckSubjectExist')
59
        PathString = "TestCNBPQuery.sqlite"
0 ignored issues
show
Coding Style Naming introduced by
The name PathString 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...
60
61
        # if SQL already exist, quit script.
62
        SQLPath = Path(PathString)
0 ignored issues
show
Coding Style Naming introduced by
The name SQLPath 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...
63
64
        # check if path is a file and exist.
65
        if SQLPath.is_file():
66
            logger.info('Test SQLite database file already exist. Gonna mess with it!')
67
            ''''Delete current database! During testing only'''
0 ignored issues
show
Unused Code introduced by
This string statement has no effect and could be removed.
Loading history...
68
            os.remove(PathString)
69
70
        # Create the database
71
        assert LocalDB_createCNBP.database(PathString)
72
        logger.info('Test SQLite database successfully created. Gonna mess with it!')
73
74
        # Populate the table with some fake records.
75
        ConnectedDatabase = sqlite3.connect(PathString)
0 ignored issues
show
Coding Style Naming introduced by
The name ConnectedDatabase 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...
76
        c = ConnectedDatabase.cursor()
0 ignored issues
show
Coding Style Naming introduced by
The name c 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...
77
        c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (291010,'CNBP0010001')".
78
                  format(tn=CNBP_blueprint.table_name, mrn=CNBP_blueprint.keyfield, cnbpid=CNBP_blueprint.fields[1]))
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (117/100).

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

Loading history...
79
        c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (292010,'CNBP0020001')".
80
                  format(tn=CNBP_blueprint.table_name, mrn=CNBP_blueprint.keyfield, cnbpid=CNBP_blueprint.fields[1]))
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (117/100).

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

Loading history...
81
        c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (295010,'CNBP0010001')".
82
                  format(tn=CNBP_blueprint.table_name, mrn=CNBP_blueprint.keyfield, cnbpid=CNBP_blueprint.fields[1]))
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (117/100).

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

Loading history...
83
        c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (297120,'CNBP0030001')".
84
                  format(tn=CNBP_blueprint.table_name, mrn=CNBP_blueprint.keyfield, cnbpid=CNBP_blueprint.fields[1]))
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (117/100).

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

Loading history...
85
        c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (291310,'CNBP0510001')".
86
                  format(tn=CNBP_blueprint.table_name, mrn=CNBP_blueprint.keyfield, cnbpid=CNBP_blueprint.fields[1]))
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (117/100).

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

Loading history...
87
        ConnectedDatabase.commit()
88
        ConnectedDatabase.close()
89
90
        logger.info('Test SQLite database successfully inserted with mock records. Gonna mess with it!')
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (104/100).

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

Loading history...
91
92
        # Create on Connecting to the database file
93
        assert(LocalDB_query.check_value(PathString, CNBP_blueprint.table_name, "MRN", 291010))
0 ignored issues
show
Unused Code Coding Style introduced by
There is an unnecessary parenthesis after assert.
Loading history...
94
        assert(LocalDB_query.check_value(PathString, CNBP_blueprint.table_name, "CNBPID", "CNBP0010001"))
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (105/100).

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

Loading history...
Unused Code Coding Style introduced by
There is an unnecessary parenthesis after assert.
Loading history...
95
96
        # Remove test data base created
97
        os.remove(PathString)
98
99
        return True
100
101
    @staticmethod
102
    def test_CreateSubjectCheckExist():
0 ignored issues
show
Coding Style Naming introduced by
The name test_CreateSubjectCheckExist 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...
103
        logger = logging.getLogger('UT_CreateAndCheck')
104
        PathString = "TestCNBPQuery.sqlite"
0 ignored issues
show
Coding Style Naming introduced by
The name PathString 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...
105
106
        # if SQL already exist, quit script.
107
        SQLPath = Path(PathString)
0 ignored issues
show
Coding Style Naming introduced by
The name SQLPath 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...
108
109
        # check if path is a file and exist.
110
        if SQLPath.is_file():
111
            logger.info('Test SQLite database file already exist. Gonna mess with it!')
112
            ''''Delete current database! During testing only'''
0 ignored issues
show
Unused Code introduced by
This string statement has no effect and could be removed.
Loading history...
113
            os.remove(PathString)
114
115
        # Create the database
116
        assert LocalDB_createCNBP.database(PathString)
117
        logger.info('Test SQLite database successfully created. Gonna mess with it!')
118
119
        tableName = 'id_table'  # All CNBP database should have this table name.
0 ignored issues
show
Coding Style Naming introduced by
The name tableName 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...
120
        MRNColumn = "MRN"
0 ignored issues
show
Coding Style Naming introduced by
The name MRNColumn 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...
121
122
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 2918210)
123
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 23452346)
124
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 2345234)
125
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 273411)
126
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 364573)
127
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 7424141)
128
129
        success, _ = LocalDB_query.check_value(PathString, tableName, MRNColumn, 7129112)
130
        assert not success
131
132
        success, _ = LocalDB_query.check_value(PathString, tableName, MRNColumn, 2918210)
133
        assert success
134
135
        success, _ = LocalDB_query.check_value(PathString, tableName, MRNColumn, 712921)
136
        assert not success
137
138
        success, _ = LocalDB_query.check_value(PathString, tableName, MRNColumn, 742)
139
        assert not success
140
141
        success, _ = LocalDB_query.check_value(PathString, tableName, MRNColumn, 364573)
142
        assert success
143
144
        logger.info('Tested SQLIte database entry. ')
145
146
        # Remove test data base created
147
        os.remove(PathString)
148
149
        return True
150
151
    @staticmethod
152
    def test_SubjectUpdate():
0 ignored issues
show
Coding Style Naming introduced by
The name test_SubjectUpdate 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...
153
        logger = logging.getLogger('UT_CreateAndCheck')
154
        PathString = "TestCNBPQuery.sqlite"
0 ignored issues
show
Coding Style Naming introduced by
The name PathString 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...
155
156
        # if SQL already exist, quit script.
157
        SQLPath = Path(PathString)
0 ignored issues
show
Coding Style Naming introduced by
The name SQLPath 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...
158
159
        # check if path is a file and exist.
160
        if SQLPath.is_file():
161
            logger.info('Test SQLite database file already exist. Gonna mess with it!')
162
            ''''Delete current database! During testing only'''
0 ignored issues
show
Unused Code introduced by
This string statement has no effect and could be removed.
Loading history...
163
            os.remove(PathString)
164
165
        # Create the database
166
        assert LocalDB_createCNBP.database(PathString)
167
        logger.info('Test SQLite database successfully created. Gonna mess with it!')
168
169
        tableName = 'id_table'  # All CNBP database should have this table name.
0 ignored issues
show
Coding Style Naming introduced by
The name tableName 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...
170
        MRNColumn = "MRN"
0 ignored issues
show
Coding Style Naming introduced by
The name MRNColumn 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...
171
        CNBPIDColumn = "CNBPID"
0 ignored issues
show
Coding Style Naming introduced by
The name CNBPIDColumn 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...
172
173
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 2918210)
174
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 23452346)
175
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 2345234)
176
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 273411)
177
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 364573)
178
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 7424141)
179
180
        success = load_dotenv()
181
        if not success:
182
            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...
183
184
        Prefix = os.getenv("institutionID")
0 ignored issues
show
Coding Style Naming introduced by
The name Prefix 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...
185
186
        LocalDB_query.update_entry(PathString, tableName, MRNColumn, 7424141, CNBPIDColumn, Prefix + "0010001")
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (111/100).

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

Loading history...
187
        LocalDB_query.update_entry(PathString, tableName, MRNColumn, 2345234, CNBPIDColumn, Prefix + "0010002")
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (111/100).

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

Loading history...
188
        LocalDB_query.update_entry(PathString, tableName, MRNColumn, 2918210, CNBPIDColumn, Prefix + "0010003")
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (111/100).

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

Loading history...
189
        LocalDB_query.update_entry(PathString, tableName, MRNColumn, 273411, CNBPIDColumn, Prefix + "0010004")
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (110/100).

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

Loading history...
190
191
        success, _ = LocalDB_query.check_value(PathString, tableName, CNBPIDColumn, 'CNBPID0010006')
192
        assert not success
193
194
        success, _ = LocalDB_query.check_value(PathString, tableName, CNBPIDColumn, Prefix + "0010001")
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (103/100).

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

Loading history...
195
        assert success
196
197
        success, _ = LocalDB_query.check_value(PathString, tableName, CNBPIDColumn, 55555)
198
        assert not success
199
200
        success, _ = LocalDB_query.check_value(PathString, tableName, CNBPIDColumn, 742)
201
        assert not success
202
203
        success, _ = LocalDB_query.check_value(PathString, tableName, CNBPIDColumn, Prefix + "0010003")
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (103/100).

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

Loading history...
204
        assert success
205
206
        logger.info('Tested SQLIte database entry. ')
207
208
        # Remove test data base created
209
        os.remove(PathString)
210
211
        return True
212
213
if __name__ == '__main__':
214
    UT_LocalDBCreate.test_SubjectUpdate()
0 ignored issues
show
Coding Style introduced by
Final newline missing
Loading history...