velocity-python 0.0.132__py3-none-any.whl → 0.0.134__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of velocity-python might be problematic. Click here for more details.
- velocity/__init__.py +1 -1
- velocity/app/tests/__init__.py +1 -0
- velocity/app/tests/test_email_processing.py +112 -0
- velocity/app/tests/test_payment_profile_sorting.py +191 -0
- velocity/app/tests/test_spreadsheet_functions.py +124 -0
- velocity/aws/tests/__init__.py +1 -0
- velocity/aws/tests/test_lambda_handler_json_serialization.py +120 -0
- velocity/aws/tests/test_response.py +163 -0
- velocity/db/core/decorators.py +20 -3
- velocity/db/core/engine.py +33 -7
- velocity/db/exceptions.py +7 -0
- velocity/db/servers/base/initializer.py +2 -1
- velocity/db/servers/mysql/__init__.py +13 -4
- velocity/db/servers/postgres/__init__.py +14 -4
- velocity/db/servers/sqlite/__init__.py +13 -4
- velocity/db/servers/sqlserver/__init__.py +13 -4
- velocity/db/tests/__init__.py +1 -0
- velocity/db/tests/common_db_test.py +0 -0
- velocity/db/tests/postgres/__init__.py +1 -0
- velocity/db/tests/postgres/common.py +49 -0
- velocity/db/tests/postgres/test_column.py +29 -0
- velocity/db/tests/postgres/test_connections.py +25 -0
- velocity/db/tests/postgres/test_database.py +21 -0
- velocity/db/tests/postgres/test_engine.py +205 -0
- velocity/db/tests/postgres/test_general_usage.py +88 -0
- velocity/db/tests/postgres/test_imports.py +8 -0
- velocity/db/tests/postgres/test_result.py +19 -0
- velocity/db/tests/postgres/test_row.py +137 -0
- velocity/db/tests/postgres/test_schema_locking.py +335 -0
- velocity/db/tests/postgres/test_schema_locking_unit.py +115 -0
- velocity/db/tests/postgres/test_sequence.py +34 -0
- velocity/db/tests/postgres/test_table.py +101 -0
- velocity/db/tests/postgres/test_transaction.py +106 -0
- velocity/db/tests/sql/__init__.py +1 -0
- velocity/db/tests/sql/common.py +177 -0
- velocity/db/tests/sql/test_postgres_select_advanced.py +285 -0
- velocity/db/tests/sql/test_postgres_select_variances.py +517 -0
- velocity/db/tests/test_cursor_rowcount_fix.py +150 -0
- velocity/db/tests/test_db_utils.py +221 -0
- velocity/db/tests/test_postgres.py +212 -0
- velocity/db/tests/test_postgres_unchanged.py +81 -0
- velocity/db/tests/test_process_error_robustness.py +292 -0
- velocity/db/tests/test_result_caching.py +279 -0
- velocity/db/tests/test_result_sql_aware.py +117 -0
- velocity/db/tests/test_row_get_missing_column.py +72 -0
- velocity/db/tests/test_schema_locking_initializers.py +226 -0
- velocity/db/tests/test_schema_locking_simple.py +97 -0
- velocity/db/tests/test_sql_builder.py +165 -0
- velocity/db/tests/test_tablehelper.py +486 -0
- velocity/misc/tests/__init__.py +1 -0
- velocity/misc/tests/test_db.py +90 -0
- velocity/misc/tests/test_fix.py +78 -0
- velocity/misc/tests/test_format.py +64 -0
- velocity/misc/tests/test_iconv.py +203 -0
- velocity/misc/tests/test_merge.py +82 -0
- velocity/misc/tests/test_oconv.py +144 -0
- velocity/misc/tests/test_original_error.py +52 -0
- velocity/misc/tests/test_timer.py +74 -0
- {velocity_python-0.0.132.dist-info → velocity_python-0.0.134.dist-info}/METADATA +1 -1
- velocity_python-0.0.134.dist-info/RECORD +125 -0
- velocity_python-0.0.132.dist-info/RECORD +0 -76
- {velocity_python-0.0.132.dist-info → velocity_python-0.0.134.dist-info}/WHEEL +0 -0
- {velocity_python-0.0.132.dist-info → velocity_python-0.0.134.dist-info}/licenses/LICENSE +0 -0
- {velocity_python-0.0.132.dist-info → velocity_python-0.0.134.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import datetime
|
|
3
|
+
import unittest
|
|
4
|
+
from velocity.db.core.engine import Engine
|
|
5
|
+
from velocity.db.core.transaction import Transaction
|
|
6
|
+
from .common import CommonPostgresTest, engine, test_db
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@engine.transaction
|
|
10
|
+
class TestEngine(CommonPostgresTest):
|
|
11
|
+
@classmethod
|
|
12
|
+
def create_test_tables(cls, tx):
|
|
13
|
+
"""No special tables needed for engine tests."""
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
def test_engine_init(self, tx):
|
|
17
|
+
import psycopg2
|
|
18
|
+
from velocity.db.servers.postgres import SQL
|
|
19
|
+
|
|
20
|
+
# Test the engine instance from common test
|
|
21
|
+
assert engine.sql == SQL
|
|
22
|
+
assert engine.driver == psycopg2
|
|
23
|
+
|
|
24
|
+
def test_engine_attributes(self, tx):
|
|
25
|
+
import psycopg2
|
|
26
|
+
from velocity.db.servers.postgres import SQL
|
|
27
|
+
|
|
28
|
+
# Test private attributes
|
|
29
|
+
assert engine._Engine__sql == SQL
|
|
30
|
+
assert engine._Engine__driver == psycopg2
|
|
31
|
+
|
|
32
|
+
def test_connect(self, tx):
|
|
33
|
+
import psycopg2
|
|
34
|
+
|
|
35
|
+
assert engine.connect() != None
|
|
36
|
+
conn = engine.connect()
|
|
37
|
+
self.assertIsInstance(conn, psycopg2.extensions.connection)
|
|
38
|
+
|
|
39
|
+
def test_other_stuff(self, tx):
|
|
40
|
+
assert engine.version[:10] == "PostgreSQL"
|
|
41
|
+
|
|
42
|
+
timestamp = engine.timestamp
|
|
43
|
+
self.assertIsInstance(timestamp, datetime.datetime)
|
|
44
|
+
assert engine.user == os.environ["DBUser"]
|
|
45
|
+
assert test_db in engine.databases
|
|
46
|
+
assert "public" in engine.schemas
|
|
47
|
+
assert "information_schema" in engine.schemas
|
|
48
|
+
assert "public" == engine.current_schema
|
|
49
|
+
assert engine.current_database == test_db
|
|
50
|
+
assert [] == engine.views
|
|
51
|
+
assert [] == engine.tables
|
|
52
|
+
|
|
53
|
+
def test_process_error(self, tx):
|
|
54
|
+
local_engine = Engine(None, None, None) # Replace None with appropriate arguments
|
|
55
|
+
with self.assertRaises(
|
|
56
|
+
Exception
|
|
57
|
+
): # Replace Exception with the specific exception raised by process_error
|
|
58
|
+
local_engine.process_error(sql_stmt=None, sql_params=None)
|
|
59
|
+
# Add additional assertions as needed
|
|
60
|
+
|
|
61
|
+
def test_transaction_injection_1(self, tx):
|
|
62
|
+
@engine.transaction
|
|
63
|
+
def function():
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
function()
|
|
67
|
+
|
|
68
|
+
@engine.transaction
|
|
69
|
+
def function(_tx):
|
|
70
|
+
pass
|
|
71
|
+
|
|
72
|
+
with self.assertRaises(NameError):
|
|
73
|
+
function()
|
|
74
|
+
|
|
75
|
+
@engine.transaction
|
|
76
|
+
def function(tx):
|
|
77
|
+
pass
|
|
78
|
+
|
|
79
|
+
with self.assertRaises(TypeError):
|
|
80
|
+
function(tx=3)
|
|
81
|
+
with self.assertRaises(TypeError):
|
|
82
|
+
function(tx=None)
|
|
83
|
+
|
|
84
|
+
def test_transaction_injection_function(self, tx):
|
|
85
|
+
with engine.transaction() as original:
|
|
86
|
+
|
|
87
|
+
@engine.transaction
|
|
88
|
+
def function(tx):
|
|
89
|
+
assert tx != None
|
|
90
|
+
assert tx != original
|
|
91
|
+
self.assertIsInstance(tx, Transaction)
|
|
92
|
+
|
|
93
|
+
function()
|
|
94
|
+
|
|
95
|
+
@engine.transaction
|
|
96
|
+
def function(tx):
|
|
97
|
+
assert tx != None
|
|
98
|
+
assert tx == original
|
|
99
|
+
self.assertIsInstance(tx, Transaction)
|
|
100
|
+
|
|
101
|
+
function(original)
|
|
102
|
+
|
|
103
|
+
@engine.transaction
|
|
104
|
+
def function(tx=None):
|
|
105
|
+
assert tx != None
|
|
106
|
+
assert tx != original
|
|
107
|
+
self.assertIsInstance(tx, Transaction)
|
|
108
|
+
|
|
109
|
+
function()
|
|
110
|
+
|
|
111
|
+
@engine.transaction
|
|
112
|
+
def function(tx=None):
|
|
113
|
+
assert tx != None
|
|
114
|
+
assert tx == original
|
|
115
|
+
self.assertIsInstance(tx, Transaction)
|
|
116
|
+
|
|
117
|
+
function(original)
|
|
118
|
+
|
|
119
|
+
@engine.transaction
|
|
120
|
+
def function(tx=None):
|
|
121
|
+
assert tx != None
|
|
122
|
+
assert tx == original
|
|
123
|
+
self.assertIsInstance(tx, Transaction)
|
|
124
|
+
|
|
125
|
+
function(tx=original)
|
|
126
|
+
|
|
127
|
+
@engine.transaction
|
|
128
|
+
def function(tx, a, b):
|
|
129
|
+
assert tx != None
|
|
130
|
+
assert tx != original
|
|
131
|
+
self.assertIsInstance(tx, Transaction)
|
|
132
|
+
|
|
133
|
+
function(1, 2)
|
|
134
|
+
|
|
135
|
+
@engine.transaction
|
|
136
|
+
def function(tx, a, b):
|
|
137
|
+
assert tx != None
|
|
138
|
+
assert tx == original
|
|
139
|
+
self.assertIsInstance(tx, Transaction)
|
|
140
|
+
|
|
141
|
+
function(original, 1, 2)
|
|
142
|
+
|
|
143
|
+
@engine.transaction
|
|
144
|
+
def function(tx, a, b):
|
|
145
|
+
assert tx != None
|
|
146
|
+
assert tx == original
|
|
147
|
+
self.assertIsInstance(tx, Transaction)
|
|
148
|
+
|
|
149
|
+
function(tx=original, a=1, b=2)
|
|
150
|
+
|
|
151
|
+
@engine.transaction
|
|
152
|
+
def function(tx, src, b):
|
|
153
|
+
assert tx != None
|
|
154
|
+
assert tx != src
|
|
155
|
+
self.assertIsInstance(tx, Transaction)
|
|
156
|
+
|
|
157
|
+
function(src=original, b=2)
|
|
158
|
+
|
|
159
|
+
@engine.transaction
|
|
160
|
+
def function(a, tx, b):
|
|
161
|
+
assert tx != None
|
|
162
|
+
assert tx != original
|
|
163
|
+
self.assertIsInstance(tx, Transaction)
|
|
164
|
+
|
|
165
|
+
function(1, 2)
|
|
166
|
+
|
|
167
|
+
@engine.transaction
|
|
168
|
+
def function(a, tx, b):
|
|
169
|
+
assert tx != None
|
|
170
|
+
assert tx == original
|
|
171
|
+
self.assertIsInstance(tx, Transaction)
|
|
172
|
+
|
|
173
|
+
function(1, original, 2)
|
|
174
|
+
|
|
175
|
+
def test_transaction_injection_class(self, tx):
|
|
176
|
+
test_class = self
|
|
177
|
+
with engine.transaction() as original:
|
|
178
|
+
|
|
179
|
+
@engine.transaction
|
|
180
|
+
class TestClass:
|
|
181
|
+
@engine.transaction
|
|
182
|
+
def __init__(self, tx):
|
|
183
|
+
assert tx != None
|
|
184
|
+
assert tx != original
|
|
185
|
+
test_class.assertIsInstance(tx, Transaction)
|
|
186
|
+
|
|
187
|
+
def first_method(self, tx):
|
|
188
|
+
assert tx != None
|
|
189
|
+
assert tx != original
|
|
190
|
+
test_class.assertIsInstance(tx, Transaction)
|
|
191
|
+
|
|
192
|
+
def second_method(self, tx):
|
|
193
|
+
assert tx != None
|
|
194
|
+
assert tx == original
|
|
195
|
+
test_class.assertIsInstance(tx, Transaction)
|
|
196
|
+
|
|
197
|
+
tc = TestClass()
|
|
198
|
+
|
|
199
|
+
tc.first_method()
|
|
200
|
+
tc.second_method(original)
|
|
201
|
+
self.assertRaises(AssertionError, tc.second_method)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
if __name__ == "__main__":
|
|
205
|
+
unittest.main()
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
import sys
|
|
3
|
+
import os
|
|
4
|
+
from .common import CommonPostgresTest, engine, test_db
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@engine.transaction
|
|
8
|
+
@engine.transaction
|
|
9
|
+
class TestFeatures(CommonPostgresTest):
|
|
10
|
+
|
|
11
|
+
@classmethod
|
|
12
|
+
def create_test_tables(cls, tx):
|
|
13
|
+
"""Clean up any existing tables for general usage tests."""
|
|
14
|
+
# Ensure clean state by dropping tables if they exist
|
|
15
|
+
tx.table("names").drop()
|
|
16
|
+
tx.table("addresses").drop()
|
|
17
|
+
|
|
18
|
+
def test_foreign_key(self, tx):
|
|
19
|
+
first = tx.table("names")
|
|
20
|
+
second = tx.table("addresses")
|
|
21
|
+
first.create(
|
|
22
|
+
{
|
|
23
|
+
"first_name": str,
|
|
24
|
+
"last_name": str,
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
second.create(
|
|
28
|
+
{
|
|
29
|
+
"address": str,
|
|
30
|
+
"address2": str,
|
|
31
|
+
"city": str,
|
|
32
|
+
"state": str,
|
|
33
|
+
"zipcode": str,
|
|
34
|
+
"country": str,
|
|
35
|
+
"name_id": int,
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
tx.commit()
|
|
39
|
+
second.create_foreign_key("name_id", "names", "sys_id")
|
|
40
|
+
first.insert(
|
|
41
|
+
{
|
|
42
|
+
"first_name": "John",
|
|
43
|
+
"last_name": "Doe",
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
tx.commit()
|
|
47
|
+
second.insert(
|
|
48
|
+
{
|
|
49
|
+
"address": "123 Main St",
|
|
50
|
+
"address2": "Apt 123",
|
|
51
|
+
"city": "New York",
|
|
52
|
+
"state": "NY",
|
|
53
|
+
"zipcode": "12345",
|
|
54
|
+
"country": "USA",
|
|
55
|
+
"name_id": 1001,
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
second.insert(
|
|
59
|
+
{
|
|
60
|
+
"address": "123 Main St",
|
|
61
|
+
"address2": "Apt 123",
|
|
62
|
+
"city": "New York",
|
|
63
|
+
"state": "NY",
|
|
64
|
+
"zipcode": "12345",
|
|
65
|
+
"country": "USA",
|
|
66
|
+
"name_id": 1001,
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
second.insert(
|
|
70
|
+
{
|
|
71
|
+
"address": "123 Main St",
|
|
72
|
+
"address2": "Apt 123",
|
|
73
|
+
"city": "New York",
|
|
74
|
+
"state": "NY",
|
|
75
|
+
"zipcode": "12345",
|
|
76
|
+
"country": "USA",
|
|
77
|
+
"name_id": 1001,
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
addresses = second.select(where={"name_id": 1001})
|
|
81
|
+
# for address in addresses:
|
|
82
|
+
# print(address)
|
|
83
|
+
|
|
84
|
+
first.drop()
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if __name__ == "__main__":
|
|
88
|
+
unittest.main()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from velocity.db.core.result import Result
|
|
3
|
+
from .common import CommonPostgresTest, engine, test_db
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@engine.transaction
|
|
7
|
+
@engine.transaction
|
|
8
|
+
class TestResult(CommonPostgresTest):
|
|
9
|
+
|
|
10
|
+
@classmethod
|
|
11
|
+
def create_test_tables(cls, tx):
|
|
12
|
+
"""No special tables needed for result tests."""
|
|
13
|
+
pass
|
|
14
|
+
def test_result_all(self, tx):
|
|
15
|
+
result = tx.execute("SELECT current_timestamp")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
if __name__ == "__main__":
|
|
19
|
+
unittest.main()
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from velocity.db.core.row import Row
|
|
3
|
+
from .common import CommonPostgresTest, engine, test_db
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@engine.transaction
|
|
7
|
+
@engine.transaction
|
|
8
|
+
class TestRow(CommonPostgresTest):
|
|
9
|
+
|
|
10
|
+
@classmethod
|
|
11
|
+
def create_test_tables(cls, tx):
|
|
12
|
+
"""Create test tables for row tests."""
|
|
13
|
+
# Create a test table for row operations
|
|
14
|
+
tx.table("test_users").create(
|
|
15
|
+
columns={
|
|
16
|
+
"name": str,
|
|
17
|
+
"age": int,
|
|
18
|
+
"email": str,
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
def test_init(self, tx):
|
|
22
|
+
pass
|
|
23
|
+
|
|
24
|
+
# def test_repr(self):
|
|
25
|
+
# expected = "{'sys_id': 1, 'sys_name': 'John', 'sys_age': 30}"
|
|
26
|
+
# self.assertEqual(repr(self.row), expected)
|
|
27
|
+
|
|
28
|
+
# def test_str(self):
|
|
29
|
+
# expected = "{'sys_id': 1, 'sys_name': 'John', 'sys_age': 30}"
|
|
30
|
+
# self.assertEqual(str(self.row), expected)
|
|
31
|
+
|
|
32
|
+
# def test_len(self):
|
|
33
|
+
# self.assertEqual(len(self.row), 1)
|
|
34
|
+
|
|
35
|
+
# def test_getitem(self):
|
|
36
|
+
# self.assertEqual(self.row['sys_name'], 'John')
|
|
37
|
+
|
|
38
|
+
# def test_setitem(self):
|
|
39
|
+
# with self.assertRaises(Exception):
|
|
40
|
+
# self.row['sys_id'] = 2
|
|
41
|
+
|
|
42
|
+
# def test_delitem(self):
|
|
43
|
+
# with self.assertRaises(Exception):
|
|
44
|
+
# del self.row['sys_id']
|
|
45
|
+
|
|
46
|
+
# def test_contains(self):
|
|
47
|
+
# self.assertTrue('sys_name' in self.row)
|
|
48
|
+
# self.assertFalse('sys_email' in self.row)
|
|
49
|
+
|
|
50
|
+
# def test_clear(self):
|
|
51
|
+
# self.row.clear()
|
|
52
|
+
# # Add assertions here to check if the row is cleared
|
|
53
|
+
|
|
54
|
+
# def test_keys(self):
|
|
55
|
+
# expected = ['sys_id', 'sys_name', 'sys_age']
|
|
56
|
+
# self.assertEqual(self.row.keys(), expected)
|
|
57
|
+
|
|
58
|
+
# def test_values(self):
|
|
59
|
+
# expected = [1, 'John', 30]
|
|
60
|
+
# self.assertEqual(self.row.values(), expected)
|
|
61
|
+
|
|
62
|
+
# def test_items(self):
|
|
63
|
+
# expected = [('sys_id', 1), ('sys_name', 'John'), ('sys_age', 30)]
|
|
64
|
+
# self.assertEqual(self.row.items(), expected)
|
|
65
|
+
|
|
66
|
+
# def test_get(self):
|
|
67
|
+
# self.assertEqual(self.row.get('sys_name'), 'John')
|
|
68
|
+
# self.assertEqual(self.row.get('sys_email'), None)
|
|
69
|
+
|
|
70
|
+
# def test_setdefault(self):
|
|
71
|
+
# self.assertEqual(self.row.setdefault('sys_name'), 'John')
|
|
72
|
+
# self.assertEqual(self.row.setdefault('sys_email', 'john@example.com'), 'john@example.com')
|
|
73
|
+
|
|
74
|
+
# def test_update(self):
|
|
75
|
+
# self.row.update({'sys_name': 'Jane', 'sys_age': 25})
|
|
76
|
+
# # Add assertions here to check if the row is updated
|
|
77
|
+
|
|
78
|
+
# def test_iterkeys(self):
|
|
79
|
+
# expected = ['sys_id', 'sys_name', 'sys_age']
|
|
80
|
+
# self.assertEqual(list(self.row.iterkeys()), expected)
|
|
81
|
+
|
|
82
|
+
# def test_itervalues(self):
|
|
83
|
+
# expected = [1, 'John', 30]
|
|
84
|
+
# self.assertEqual(list(self.row.itervalues()), expected)
|
|
85
|
+
|
|
86
|
+
# def test_iteritems(self):
|
|
87
|
+
# expected = [('sys_id', 1), ('sys_name', 'John'), ('sys_age', 30)]
|
|
88
|
+
# self.assertEqual(list(self.row.iteritems()), expected)
|
|
89
|
+
|
|
90
|
+
# def test_bool(self):
|
|
91
|
+
# self.assertTrue(bool(self.row))
|
|
92
|
+
|
|
93
|
+
# def test_copy(self):
|
|
94
|
+
# copied_row = self.row.copy()
|
|
95
|
+
# # Add assertions here to check if the row is copied correctly
|
|
96
|
+
|
|
97
|
+
# def test_to_dict(self):
|
|
98
|
+
# expected = {'sys_id': 1, 'sys_name': 'John', 'sys_age': 30}
|
|
99
|
+
# self.assertEqual(self.row.to_dict(), expected)
|
|
100
|
+
|
|
101
|
+
# def test_extract(self):
|
|
102
|
+
# expected = {'sys_id': 1, 'sys_name': 'John'}
|
|
103
|
+
# self.assertEqual(self.row.extract('sys_id', 'sys_name'), expected)
|
|
104
|
+
|
|
105
|
+
# def test_key_cols(self):
|
|
106
|
+
# expected = ['sys_id']
|
|
107
|
+
# self.assertEqual(self.row.key_cols, expected)
|
|
108
|
+
|
|
109
|
+
# def test_split(self):
|
|
110
|
+
# data, pk = self.row.split()
|
|
111
|
+
# # Add assertions here to check if the row is split correctly
|
|
112
|
+
|
|
113
|
+
# def test_data(self):
|
|
114
|
+
# data = self.row.data
|
|
115
|
+
# # Add assertions here to check if the data is extracted correctly
|
|
116
|
+
|
|
117
|
+
# def test_row(self):
|
|
118
|
+
# row = self.row.row('sys_id')
|
|
119
|
+
# # Add assertions here to check if the row is fetched correctly
|
|
120
|
+
|
|
121
|
+
# def test_match(self):
|
|
122
|
+
# other = {'sys_id': 1, 'sys_name': 'John', 'sys_age': 30}
|
|
123
|
+
# self.assertTrue(self.row.match(other))
|
|
124
|
+
# other = {'sys_id': 2, 'sys_name': 'Jane', 'sys_age': 25}
|
|
125
|
+
# self.assertFalse(self.row.match(other))
|
|
126
|
+
|
|
127
|
+
# def test_touch(self):
|
|
128
|
+
# self.row.touch()
|
|
129
|
+
# # Add assertions here to check if the row is touched correctly
|
|
130
|
+
|
|
131
|
+
# def test_delete(self):
|
|
132
|
+
# self.row.delete()
|
|
133
|
+
# # Add assertions here to check if the row is deleted correctly
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
if __name__ == "__main__":
|
|
137
|
+
unittest.main()
|