Completed
Pull Request — master (#3)
by Yang
04:29
created

UT_LocalDBCreate.test_SubjectUpdate()   B

Complexity

Conditions 3

Size

Total Lines 61
Code Lines 40

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 40
nop 0
dl 0
loc 61
rs 8.92
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

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
11
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
12
13
14
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...
15
16
    @staticmethod
17
    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...
18
        logger = logging.getLogger('UT_CreateSubject')
19
        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...
20
21
        # if SQL already exist, quit script.
22
        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...
23
24
        # check if path is a file and exist.
25
        if SQLPath.is_file():
26
            logger.info('Test SQLite database file already exist. Gonna mess with it!')
27
            ''''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...
28
            os.remove(PathString)
29
30
        # Create the database
31
        assert LocalDB_createCNBP.database(PathString)
32
        logger.info('Test SQLite database successfully created. Gonna mess with it!')
33
34
        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...
35
        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...
36
37
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 291033)
38
        logger.info('Test SQLite database successfully inserted with mock records. Gonna check!')
39
40
        # Populate the table with some fake records.
41
        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...
42
        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...
43
        c.execute(
44
            'SELECT * FROM {tablename} WHERE {columnname}="{columnvalue}"'.
45
                format(tablename=tableName, columnname=MRNColumn,columnvalue=291033))
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation (remove 4 spaces).
Loading history...
Coding Style introduced by
Exactly one space required after comma
Loading history...
46
        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...
47
48
        assert len(ResultRows) > 0
0 ignored issues
show
Unused Code introduced by
Do not use len(SEQUENCE) as condition value
Loading history...
49
50
        # Closing the connection to the database file
51
        ConnectedDatabase.close()
52
53
        # Remove test data base created
54
        os.remove(PathString)
55
56
        return True
57
58
    @staticmethod
59
    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...
60
        logger = logging.getLogger('UT_CheckSubjectExist')
61
        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...
62
63
        # if SQL already exist, quit script.
64
        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...
65
66
        # check if path is a file and exist.
67
        if SQLPath.is_file():
68
            logger.info('Test SQLite database file already exist. Gonna mess with it!')
69
            ''''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...
70
            os.remove(PathString)
71
72
        # Create the database
73
        assert LocalDB_createCNBP.database(PathString)
74
        logger.info('Test SQLite database successfully created. Gonna mess with it!')
75
76
        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...
77
        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...
78
        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...
79
80
        # Populate the table with some fake records.
81
        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...
82
        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...
83
        c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (291010,'CNBP0010001')".
84
                  format(tn=tableName, mrn=MRNColumn, cnbpid=CNBPIDColumn))
85
        c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (292010,'CNBP0020001')".
86
                  format(tn=tableName, mrn=MRNColumn, cnbpid=CNBPIDColumn))
87
        c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (295010,'CNBP0010001')".
88
                  format(tn=tableName, mrn=MRNColumn, cnbpid=CNBPIDColumn))
89
        c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (297120,'CNBP0030001')".
90
                  format(tn=tableName, mrn=MRNColumn, cnbpid=CNBPIDColumn))
91
        c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (291310,'CNBP0510001')".
92
                  format(tn=tableName, mrn=MRNColumn, cnbpid=CNBPIDColumn))
93
        ConnectedDatabase.commit()
94
        ConnectedDatabase.close()
95
96
        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...
97
98
        # Create on Connecting to the database file
99
        assert(LocalDB_query.check_value(PathString, tableName, "MRN", 291010))
0 ignored issues
show
Unused Code Coding Style introduced by
There is an unnecessary parenthesis after assert.
Loading history...
100
        assert(LocalDB_query.check_value(PathString, tableName, "CNBPID", "CNBP0010001"))
0 ignored issues
show
Unused Code Coding Style introduced by
There is an unnecessary parenthesis after assert.
Loading history...
101
102
        # Remove test data base created
103
        os.remove(PathString)
104
105
        return True
106
107
    @staticmethod
108
    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...
109
        logger = logging.getLogger('UT_CreateAndCheck')
110
        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...
111
112
        # if SQL already exist, quit script.
113
        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...
114
115
        # check if path is a file and exist.
116
        if SQLPath.is_file():
117
            logger.info('Test SQLite database file already exist. Gonna mess with it!')
118
            ''''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...
119
            os.remove(PathString)
120
121
        # Create the database
122
        assert LocalDB_createCNBP.database(PathString)
123
        logger.info('Test SQLite database successfully created. Gonna mess with it!')
124
125
        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...
126
        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...
127
128
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 2918210)
129
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 23452346)
130
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 2345234)
131
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 273411)
132
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 364573)
133
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 7424141)
134
135
        success, _ = LocalDB_query.check_value(PathString, tableName, MRNColumn, 7129112)
136
        assert not success
137
138
        success, _ = LocalDB_query.check_value(PathString, tableName, MRNColumn, 2918210)
139
        assert success
140
141
        success, _ = LocalDB_query.check_value(PathString, tableName, MRNColumn, 712921)
142
        assert not success
143
144
        success, _ = LocalDB_query.check_value(PathString, tableName, MRNColumn, 742)
145
        assert not success
146
147
        success, _ = LocalDB_query.check_value(PathString, tableName, MRNColumn, 364573)
148
        assert success
149
150
        logger.info('Tested SQLIte database entry. ')
151
152
        # Remove test data base created
153
        os.remove(PathString)
154
155
        return True
156
157
    @staticmethod
158
    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...
159
        logger = logging.getLogger('UT_CreateAndCheck')
160
        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...
161
162
        # if SQL already exist, quit script.
163
        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...
164
165
        # check if path is a file and exist.
166
        if SQLPath.is_file():
167
            logger.info('Test SQLite database file already exist. Gonna mess with it!')
168
            ''''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...
169
            os.remove(PathString)
170
171
        # Create the database
172
        assert LocalDB_createCNBP.database(PathString)
173
        logger.info('Test SQLite database successfully created. Gonna mess with it!')
174
175
        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...
176
        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...
177
        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...
178
179
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 2918210)
180
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 23452346)
181
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 2345234)
182
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 273411)
183
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 364573)
184
        LocalDB_query.create_entry(PathString, tableName, MRNColumn, 7424141)
185
186
        success = load_dotenv()
187
        if not success:
188
            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...
189
190
        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...
191
192
        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...
193
        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...
194
        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...
195
        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...
196
197
        success, _ = LocalDB_query.check_value(PathString, tableName, CNBPIDColumn, 'CNBPID0010006')
198
        assert not success
199
200
        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...
201
        assert success
202
203
        success, _ = LocalDB_query.check_value(PathString, tableName, CNBPIDColumn, 55555)
204
        assert not success
205
206
        success, _ = LocalDB_query.check_value(PathString, tableName, CNBPIDColumn, 742)
207
        assert not success
208
209
        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...
210
        assert success
211
212
        logger.info('Tested SQLIte database entry. ')
213
214
        # Remove test data base created
215
        os.remove(PathString)
216
217
        return True
218
219
if __name__ == '__main__':
220
    UT_LocalDBCreate.test_SubjectUpdate()
0 ignored issues
show
Coding Style introduced by
Final newline missing
Loading history...