Skip to content

Commit

Permalink
Fix missing alias logs
Browse files Browse the repository at this point in the history
  • Loading branch information
bhirsz committed Nov 5, 2023
1 parent 0d2112f commit 908b2e1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/DatabaseLibrary/assertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def row_count_is_0(self, selectStatement, sansTran=False, msg=None, alias=None):
Using optional `msg` to override the default error message:
| Row Count is 0 | SELECT id FROM person WHERE first_name = 'Franz Allan' | msg=my error message |
"""
logger.info(f"Executing : Row Count Is 0 | selectStatement")
logger.info(f"Executing : Row Count Is 0 [{alias}] | selectStatement")
num_rows = self.row_count(selectStatement, sansTran, alias=alias)
if num_rows > 0:
raise AssertionError(msg or f"Expected 0 rows, but {num_rows} were returned from: '{selectStatement}'")
Expand Down Expand Up @@ -141,7 +141,7 @@ def row_count_is_equal_to_x(self, selectStatement, numRows, sansTran=False, msg=
Using optional `msg` to override the default error message:
| Row Count Is Equal To X | SELECT id FROM person | 1 | msg=my error message |
"""
logger.info(f"Executing : Row Count Is Equal To X | {selectStatement} | {numRows}")
logger.info(f"Executing : Row Count Is Equal To X [{alias}] | {selectStatement} | {numRows}")
num_rows = self.row_count(selectStatement, sansTran, alias=alias)
if num_rows != int(numRows.encode("ascii")):
raise AssertionError(
Expand Down Expand Up @@ -174,7 +174,7 @@ def row_count_is_greater_than_x(self, selectStatement, numRows, sansTran=False,
Using optional `msg` to override the default error message:
| Row Count Is Greater Than X | SELECT id FROM person WHERE first_name = 'John' | 0 | msg=my error message |
"""
logger.info(f"Executing : Row Count Is Greater Than X | {selectStatement} | {numRows}")
logger.info(f"Executing : Row Count Is Greater Than X [{alias}] | {selectStatement} | {numRows}")
num_rows = self.row_count(selectStatement, sansTran, alias=alias)
if num_rows <= int(numRows.encode("ascii")):
raise AssertionError(
Expand Down Expand Up @@ -207,7 +207,7 @@ def row_count_is_less_than_x(self, selectStatement, numRows, sansTran=False, msg
Using optional `msg` to override the default error message:
| Row Count Is Less Than X | SELECT id FROM person WHERE first_name = 'John' | 1 | msg=my error message |
"""
logger.info(f"Executing : Row Count Is Less Than X | {selectStatement} | {numRows}")
logger.info(f"Executing : Row Count Is Less Than X [{alias}] | {selectStatement} | {numRows}")
num_rows = self.row_count(selectStatement, sansTran, alias=alias)
if num_rows >= int(numRows.encode("ascii")):
raise AssertionError(
Expand Down Expand Up @@ -235,7 +235,7 @@ def table_must_exist(self, tableName, sansTran=False, msg=None, alias=None):
Using optional `msg` to override the default error message:
| Table Must Exist | first_name | msg=my error message |
"""
logger.info("Executing : Table Must Exist | %s " % tableName)
logger.info(f"Executing : Table Must Exist [{alias}] | {tableName}")
_, db_api_module_name = self._cache.switch(alias)
if db_api_module_name in ["cx_Oracle", "oracledb"]:
selectStatement = (
Expand Down

0 comments on commit 908b2e1

Please sign in to comment.