"""Test snowflake_copy_results queries.""" from dags.templates.accounting_run_commit import snowflake_copy_results def test_copy_accounting_run_results_distro_template(): """Test that the template renders the insert statement correctly.""" template = snowflake_copy_results.copy_accounting_run_results_distro_template().render( environment='test', accounting_run_id=2 ) assert template == """ INSERT INTO ROYALTY_ACCOUNTING.test.ACCOUNTING_RUN_RESULTS_DISTRO SELECT * FROM ROYALTY_ACCOUNTING.test.ACCOUNTING_RUN_RESULTS_DISTRO_STAGING source WHERE source.ACCOUNTING_RUN_ID = 2 """ def test_copy_accounting_run_results_nr_template(): """Test that the template renders the insert statement correctly.""" template = snowflake_copy_results.copy_accounting_run_results_nr_template().render( environment='test', accounting_run_id=2 ) assert template == """ INSERT INTO ROYALTY_ACCOUNTING.test.ACCOUNTING_RUN_RESULTS_NR SELECT * FROM ROYALTY_ACCOUNTING.test.ACCOUNTING_RUN_RESULTS_NR_STAGING source WHERE source.ACCOUNTING_RUN_ID = 2 """