2 @message |
assert
Blobs: N, total length: M, blob pages: P
- Level 0: X, total length: M, blob pages: P
- Level 1: X, total length: M, blob pages: P
- Level 2: X, total length: M, blob pages: P
- Table size: N bytes
LOG DETAILS:
2025-02-14 14:31:22.675
2025-02-14 14:31:22.686 act = <firebird.qa.plugin.Action object at [hex]>
2025-02-14 14:31:22.696 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-02-14 14:31:22.705
2025-02-14 14:31:22.712 @pytest.mark.version('>=5.0.2')
2025-02-14 14:31:22.723 def test_1(act: Action, capsys):
2025-02-14 14:31:22.731
2025-02-14 14:31:22.741 act.isql(switches = ['-q'], input = test_sql, combine_output = True)
2025-02-14 14:31:22.753
2025-02-14 14:31:22.766 # Pipe of command to ISQL before 6.x leads to appearing of following 'noise info':
2025-02-14 14:31:22.776 # Database: localhost:..., User: SYSDBA
2025-02-14 14:31:22.785 # ...
2025-02-14 14:31:22.792 # We have to use 'clean_stdout' in order to ignore this:
2025-02-14 14:31:22.800 assert act.clean_stdout == ''
2025-02-14 14:31:22.806 act.reset()
2025-02-14 14:31:22.814
2025-02-14 14:31:22.820 #---------------------------------------------------------------------------------
2025-02-14 14:31:22.830
2025-02-14 14:31:22.843 blob_overall_info_ptn = re.compile( r'Blobs:\s+\d+,\s+total\s+length:\s+\d+,\s+blob\s+pages', re.IGNORECASE )
2025-02-14 14:31:22.855 blob_level_info_ptn = re.compile( r'Level\s+\d+: \d+,\s+total\s+length: \d+,\s+blob\s+pages', re.IGNORECASE )
2025-02-14 14:31:22.865 table_size_ptn = re.compile( r'Table\s+size:\s+\d+\s+bytes', re.IGNORECASE )
2025-02-14 14:31:22.874
2025-02-14 14:31:22.887 act.gstat(switches=['-r'])
2025-02-14 14:31:22.897 blob_overall_found = False
2025-02-14 14:31:22.910 for line in act.stdout.splitlines():
2025-02-14 14:31:22.920 if blob_overall_info_ptn.search(line):
2025-02-14 14:31:22.928 blob_overall_found = True
2025-02-14 14:31:22.941 print(line)
2025-02-14 14:31:22.949 if blob_overall_found:
2025-02-14 14:31:22.964 if blob_level_info_ptn.search(line):
2025-02-14 14:31:22.975 print(line)
2025-02-14 14:31:22.984 if table_size_ptn.search(line):
2025-02-14 14:31:22.994 print(line)
2025-02-14 14:31:23.004
2025-02-14 14:31:23.013
2025-02-14 14:31:23.020 act.expected_stdout = """
2025-02-14 14:31:23.028 Blobs: N, total length: M, blob pages: P
2025-02-14 14:31:23.034 Level 0: X, total length: M, blob pages: P
2025-02-14 14:31:23.044 Level 1: X, total length: M, blob pages: P
2025-02-14 14:31:23.053 Level 2: X, total length: M, blob pages: P
2025-02-14 14:31:23.061 Table size: N bytes
2025-02-14 14:31:23.071 """
2025-02-14 14:31:23.083 act.stdout = capsys.readouterr().out
2025-02-14 14:31:23.098 > assert act.clean_stdout == act.clean_expected_stdout
2025-02-14 14:31:23.109 E assert
2025-02-14 14:31:23.118 E Blobs: N, total length: M, blob pages: P
2025-02-14 14:31:23.134 E - Level 0: X, total length: M, blob pages: P
2025-02-14 14:31:23.144 E - Level 1: X, total length: M, blob pages: P
2025-02-14 14:31:23.153 E - Level 2: X, total length: M, blob pages: P
2025-02-14 14:31:23.161 E - Table size: N bytes
2025-02-14 14:31:23.169
2025-02-14 14:31:23.177 tests/bugs/gh_8394_test.py:101: AssertionError
2025-02-14 14:31:23.184 ---------------------------- Captured stdout setup -----------------------------
2025-02-14 14:31:23.191 Creating db: localhost:/var/tmp/qa_2024/test_11682/test.fdb [page_size=8192, sql_dialect=None, charset='NONE', user=SYSDBA, password=masterkey]
|
3 #text |
act = <firebird.qa.plugin.Action pytest object at [hex]>
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=5.0.2')
def test_1(act: Action, capsys):
act.isql(switches = ['-q'], input = test_sql, combine_output = True)
# Pipe of command to ISQL before 6.x leads to appearing of following 'noise info':
# Database: localhost:..., User: SYSDBA
# SQL> SQL> SQL> SQL> SQL> SQL> SQL> ...
# We have to use 'clean_stdout' in order to ignore this:
assert act.clean_stdout == ''
act.reset()
#---------------------------------------------------------------------------------
blob_overall_info_ptn = re.compile( r'Blobs:\s+\d+,\s+total\s+length:\s+\d+,\s+blob\s+pages', re.IGNORECASE )
blob_level_info_ptn = re.compile( r'Level\s+\d+: \d+,\s+total\s+length: \d+,\s+blob\s+pages', re.IGNORECASE )
table_size_ptn = re.compile( r'Table\s+size:\s+\d+\s+bytes', re.IGNORECASE )
act.gstat(switches=['-r'])
blob_overall_found = False
for line in act.stdout.splitlines():
if blob_overall_info_ptn.search(line):
blob_overall_found = True
print(line)
if blob_overall_found:
if blob_level_info_ptn.search(line):
print(line)
if table_size_ptn.search(line):
print(line)
act.expected_stdout = """
Blobs: N, total length: M, blob pages: P
Level 0: X, total length: M, blob pages: P
Level 1: X, total length: M, blob pages: P
Level 2: X, total length: M, blob pages: P
Table size: N bytes
"""
act.stdout = capsys.readouterr().out
> assert act.clean_stdout == act.clean_expected_stdout
E assert
E Blobs: N, total length: M, blob pages: P
E - Level 0: X, total length: M, blob pages: P
E - Level 1: X, total length: M, blob pages: P
E - Level 2: X, total length: M, blob pages: P
E - Table size: N bytes
tests/bugs/gh_8394_test.py:101: AssertionError
|