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

test_CreateSubject()   A

Complexity

Conditions 4

Size

Total Lines 41
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 24
dl 0
loc 41
rs 9.304
c 0
b 0
f 0
cc 4
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 check_value, update_entry, create_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...
7
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...
8
9
10
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
11
12
def test_CreateSubject():
0 ignored issues
show
Coding Style Naming introduced by
The name test_CreateSubject 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...
13
    logger = logging.getLogger('UT_CreateSubject')
14
    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...
15
16
    # if SQL already exist, quit script.
17
    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...
18
19
    # check if path is a file and exist.
20
    if SQLPath.is_file():
21
        logger.info('Test SQLite database file already exist. Gonna mess with it!')
22
        ''''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...
23
        os.remove(PathString)
24
25
    # Create the database
26
    assert create_localDB_CNBP(PathString)
27
    logger.info('Test SQLite database successfully created. Gonna mess with it!')
28
29
    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...
30
    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...
31
    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...
Unused Code introduced by
The variable CNBPIDColumn seems to be unused.
Loading history...
32
33
    create_entry(PathString, tableName, MRNColumn, 291033)
34
    logger.info('Test SQLite database successfully inserted with mock records. Gonna check!')
35
36
    # Populate the table with some fake records.
37
    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...
38
    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...
39
    c.execute(
40
        'SELECT * FROM {tablename} WHERE {columnname}="{columnvalue}"'.
41
            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...
42
    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...
43
44
    assert len(ResultRows) > 0
0 ignored issues
show
Unused Code introduced by
Do not use len(SEQUENCE) as condition value
Loading history...
45
46
    # Closing the connection to the database file
47
    ConnectedDatabase.close()
48
49
    # Remove test data base created
50
    os.remove(PathString)
51
52
    return True
53
54
def test_CheckSubjectExist():
0 ignored issues
show
Coding Style Naming introduced by
The name test_CheckSubjectExist 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...
55
    logger = logging.getLogger('UT_CheckSubjectExist')
56
    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...
57
58
    # if SQL already exist, quit script.
59
    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...
60
61
    # check if path is a file and exist.
62
    if SQLPath.is_file():
63
        logger.info('Test SQLite database file already exist. Gonna mess with it!')
64
        ''''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...
65
        os.remove(PathString)
66
67
    # Create the database
68
    assert create_localDB_CNBP(PathString)
69
    logger.info('Test SQLite database successfully created. Gonna mess with it!')
70
71
    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...
72
    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...
73
    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...
74
75
    # Populate the table with some fake records.
76
    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...
77
    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...
78
    c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (291010,'CNBP0010001')".
79
              format(tn=tableName, mrn=MRNColumn, cnbpid=CNBPIDColumn))
80
    c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (292010,'CNBP0020001')".
81
              format(tn=tableName, mrn=MRNColumn, cnbpid=CNBPIDColumn))
82
    c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (295010,'CNBP0010001')".
83
              format(tn=tableName, mrn=MRNColumn, cnbpid=CNBPIDColumn))
84
    c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (297120,'CNBP0030001')".
85
              format(tn=tableName, mrn=MRNColumn, cnbpid=CNBPIDColumn))
86
    c.execute("INSERT INTO {tn} ({mrn},{cnbpid}) VALUES (291310,'CNBP0510001')".
87
              format(tn=tableName, mrn=MRNColumn, cnbpid=CNBPIDColumn))
88
    ConnectedDatabase.commit()
89
    ConnectedDatabase.close()
90
91
    logger.info('Test SQLite database successfully inserted with mock records. Gonna mess with it!')
92
93
    # Create on Connecting to the database file
94
    assert(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...
95
    assert(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...
96
97
    # Remove test data base created
98
    os.remove(PathString)
99
100
    return True
101
102
def test_CreateSubjectCheckExist():
0 ignored issues
show
Coding Style Naming introduced by
The name test_CreateSubjectCheckExist 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...
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 create_localDB_CNBP(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
    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...
Unused Code introduced by
The variable CNBPIDColumn seems to be unused.
Loading history...
122
123
    create_entry(PathString, tableName, MRNColumn, 2918210)
124
    create_entry(PathString, tableName, MRNColumn, 23452346)
125
    create_entry(PathString, tableName, MRNColumn, 2345234)
126
    create_entry(PathString, tableName, MRNColumn, 273411)
127
    create_entry(PathString, tableName, MRNColumn, 364573)
128
    create_entry(PathString, tableName, MRNColumn, 7424141)
129
130
    success, _ = check_value(PathString, tableName, MRNColumn, 7129112)
131
    assert not success
132
133
    success, _ = check_value(PathString, tableName, MRNColumn, 2918210)
134
    assert success
135
136
    success, _ = check_value(PathString, tableName, MRNColumn, 712921)
137
    assert not success
138
139
    success, _ = check_value(PathString, tableName, MRNColumn, 742)
140
    assert not success
141
142
    success, _ = check_value(PathString, tableName, MRNColumn, 364573)
143
    assert success
144
145
    logger.info('Tested SQLIte database entry. ')
146
147
    # Remove test data base created
148
    os.remove(PathString)
149
150
    return True
151
152
def test_SubjectUpdate():
0 ignored issues
show
Coding Style Naming introduced by
The name test_SubjectUpdate 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...
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 create_localDB_CNBP(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
    create_entry(PathString, tableName, MRNColumn, 2918210)
174
    create_entry(PathString, tableName, MRNColumn, 23452346)
175
    create_entry(PathString, tableName, MRNColumn, 2345234)
176
    create_entry(PathString, tableName, MRNColumn, 273411)
177
    create_entry(PathString, tableName, MRNColumn, 364573)
178
    create_entry(PathString, tableName, MRNColumn, 7424141)
179
180
    update_entry(PathString, tableName, MRNColumn, 7424141, CNBPIDColumn, "CNBPID0010001")
181
    update_entry(PathString, tableName, MRNColumn, 2345234, CNBPIDColumn, "CNBPID0010002")
182
    update_entry(PathString, tableName, MRNColumn, 2918210, CNBPIDColumn, "CNBPID0010003")
183
    update_entry(PathString, tableName, MRNColumn, 273411, CNBPIDColumn, "CNBPID0010004")
184
185
    success, _ = check_value(PathString, tableName, CNBPIDColumn, 'CNBPID0010006')
186
    assert not success
187
188
    success, _ = check_value(PathString, tableName, CNBPIDColumn, 'CNBPID0010001')
189
    assert success
190
191
    success, _ = check_value(PathString, tableName, CNBPIDColumn, 55555)
192
    assert not success
193
194
    success, _ = check_value(PathString, tableName, CNBPIDColumn, 742)
195
    assert not success
196
197
    success, _ = check_value(PathString, tableName, CNBPIDColumn, 'CNBPID0010003')
198
    assert success
199
200
    logger.info('Tested SQLIte database entry. ')
201
202
    # Remove test data base created
203
    os.remove(PathString)
204
205
    return True
206
207
if __name__ == '__main__':
208
    test_SubjectUpdate()
0 ignored issues
show
Coding Style introduced by
Final newline missing
Loading history...