Fixed API test cases.

This commit is contained in:
Akshay Joshi
2022-10-20 17:47:27 +05:30
parent db5e181b4f
commit 964c7b1d28
5 changed files with 17 additions and 5 deletions

View File

@@ -28,7 +28,7 @@ def upgrade():
with op.batch_alter_table("user") as batch_op:
batch_op.create_check_constraint(
"ck_active_range",
"active IN (true, false)"
"active IN (0, 1)"
)

View File

@@ -121,7 +121,10 @@ class BatchProcessTest(BaseTestGenerator):
current_app.PGADMIN_RUNTIME = False
def db_session_add_mock(j):
cmd_obj = loads(j.desc)
try:
cmd_obj = loads(bytes.fromhex(j.desc))
except Exception:
cmd_obj = loads(j.desc)
self.assertTrue(isinstance(cmd_obj, IProcessDesc))
self.assertEqual(cmd_obj.backup_type,
self.class_params['type'])

View File

@@ -114,7 +114,10 @@ class BatchProcessTest(BaseTestGenerator):
current_app.PGADMIN_RUNTIME = False
def db_session_add_mock(j):
cmd_obj = loads(j.desc)
try:
cmd_obj = loads(bytes.fromhex(j.desc))
except Exception:
cmd_obj = loads(j.desc)
self.assertTrue(isinstance(cmd_obj, IProcessDesc))
self.assertEqual(cmd_obj.bfile, self.params['filename'])

View File

@@ -79,7 +79,10 @@ class BatchProcessTest(BaseTestGenerator):
self.port = port
def db_session_add_mock(j):
cmd_obj = loads(j.desc)
try:
cmd_obj = loads(bytes.fromhex(j.desc))
except Exception:
cmd_obj = loads(j.desc)
self.assertTrue(isinstance(cmd_obj, IProcessDesc))
self.assertEqual(cmd_obj.query, self.class_params['cmd'])
self.assertEqual(cmd_obj.message, self.expected_msg)

View File

@@ -66,7 +66,10 @@ class BatchProcessTest(BaseTestGenerator):
current_app.PGADMIN_RUNTIME = False
def db_session_add_mock(j):
cmd_obj = loads(j.desc)
try:
cmd_obj = loads(bytes.fromhex(j.desc))
except Exception:
cmd_obj = loads(j.desc)
self.assertTrue(isinstance(cmd_obj, IProcessDesc))
self.assertEqual(cmd_obj.bfile, self.class_params['bfile'])
self.assertEqual(cmd_obj.cmd,