import pytest from test_cases.test_table_counts import * from test_cases.test_sax_abacus import * from documentation.test_result_documentation import write_test_result if __name__ == '__main__': # Prompt user for table and column names for minus query test case # abacus_table_name = input('Enter the name of the abacus table for the minus query: (DB.SCHEMA.TABLE_NAME) ') # table2_name = input('Enter the name of the second table for the minus query: ') # abacus_col_expr = input('Enter the Abacus column names for the minus query (comma-separated): ').split(',') # sax_denorm_col_expr = input('Enter the SAX Denorm column names for the minus query (comma-separated): ').split(',') test_sax_abacus # Test case for table counts # try: # table1_count, table2_count = test_table_counts(abacus_table_name, table2_name) # write_test_result('test_table_counts', 'Passed', f'The table count for {abacus_table_name} with count {table1_count} matches {table2_name} with count {table2_count}') # except AssertionError as e: # write_test_result('test_table_counts', 'Failed', str(e)) # test_minus_query('agreement_id','sax_agreement_id', 'royalty_accounting.prod.vw_dim_abacus_contract') # # Run minus query test case # try: # columns = test_minus_query(sax_denorm_col_expr, abacus_col_expr, abacus_table_name) # write_test_result('test_minus_query', 'Passed', f'The result of the minus query is as expected for the columns - {columns} ') # except AssertionError as e: # write_test_result('test_minus_query', 'Failed', str(e)) # # Print test result summary # print('Test results:') # with open('test_result_summary.txt', 'w') as f: # f.write('Test results:\n\n') # with open('test_result.txt', 'r') as doc_file: # f.write(doc_file.read())