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 09:37:03.850
2025-02-14 09:37:03.850 act = <firebird.qa.plugin.Action object at [hex]>
2025-02-14 09:37:03.850 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-02-14 09:37:03.851
2025-02-14 09:37:03.851 @pytest.mark.version('>=5.0.2')
2025-02-14 09:37:03.851 def test_1(act: Action, capsys):
2025-02-14 09:37:03.851
2025-02-14 09:37:03.851 act.isql(switches = ['-q'], input = test_sql, combine_output = True)
2025-02-14 09:37:03.851
2025-02-14 09:37:03.851 # Pipe of command to ISQL before 6.x leads to appearing of following 'noise info':
2025-02-14 09:37:03.851 # Database: localhost:..., User: SYSDBA
2025-02-14 09:37:03.851 # ...
2025-02-14 09:37:03.851 # We have to use 'clean_stdout' in order to ignore this:
2025-02-14 09:37:03.851 assert act.clean_stdout == ''
2025-02-14 09:37:03.851 act.reset()
2025-02-14 09:37:03.851
2025-02-14 09:37:03.851 #---------------------------------------------------------------------------------
2025-02-14 09:37:03.851
2025-02-14 09:37:03.851 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 09:37:03.851 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 09:37:03.851 table_size_ptn = re.compile( r'Table\s+size:\s+\d+\s+bytes', re.IGNORECASE )
2025-02-14 09:37:03.851
2025-02-14 09:37:03.852 act.gstat(switches=['-r'])
2025-02-14 09:37:03.852 blob_overall_found = False
2025-02-14 09:37:03.852 for line in act.stdout.splitlines():
2025-02-14 09:37:03.852 if blob_overall_info_ptn.search(line):
2025-02-14 09:37:03.852 blob_overall_found = True
2025-02-14 09:37:03.852 print(line)
2025-02-14 09:37:03.852 if blob_overall_found:
2025-02-14 09:37:03.852 if blob_level_info_ptn.search(line):
2025-02-14 09:37:03.852 print(line)
2025-02-14 09:37:03.852 if table_size_ptn.search(line):
2025-02-14 09:37:03.852 print(line)
2025-02-14 09:37:03.852
2025-02-14 09:37:03.852
2025-02-14 09:37:03.852 act.expected_stdout = """
2025-02-14 09:37:03.852 Blobs: N, total length: M, blob pages: P
2025-02-14 09:37:03.852 Level 0: X, total length: M, blob pages: P
2025-02-14 09:37:03.852 Level 1: X, total length: M, blob pages: P
2025-02-14 09:37:03.852 Level 2: X, total length: M, blob pages: P
2025-02-14 09:37:03.852 Table size: N bytes
2025-02-14 09:37:03.852 """
2025-02-14 09:37:03.853 act.stdout = capsys.readouterr().out
2025-02-14 09:37:03.853 > assert act.clean_stdout == act.clean_expected_stdout
2025-02-14 09:37:03.853 E assert
2025-02-14 09:37:03.853 E Blobs: N, total length: M, blob pages: P
2025-02-14 09:37:03.853 E - Level 0: X, total length: M, blob pages: P
2025-02-14 09:37:03.853 E - Level 1: X, total length: M, blob pages: P
2025-02-14 09:37:03.853 E - Level 2: X, total length: M, blob pages: P
2025-02-14 09:37:03.853 E - Table size: N bytes
2025-02-14 09:37:03.853
2025-02-14 09:37:03.853 tests\bugs\gh_8394_test.py:101: AssertionError
2025-02-14 09:37:03.853 ---------------------------- Captured stdout setup ----------------------------
2025-02-14 09:37:03.853 Creating db: localhost:H:\QA\temp\qa2024.tmp\fbqa\test_11704\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
|