def client_with_db(): db_name = create_test_db() # create options with db name options = create_mssql_cli_options() options.database = db_name cl = create_mssql_cli_client(options) yield cl # cleanup shutdown(cl) clean_up_test_db(db_name)
def test_multiple_merge(self): """ Tests query with multiple merges. Requires creation of temp db. """ try: # create temporary db db_name = create_test_db() file_input, file_baseline = get_io_paths('multiple_merge.txt') text_baseline = get_file_contents(file_baseline) # test with -i output_query = self.execute_query_via_subprocess("-i {} -d {}"\ .format(file_input, db_name)) assert output_query == text_baseline finally: clean_up_test_db(db_name)
def test_db(): db = create_test_db() yield db clean_up_test_db(db)
def tearDownClass(cls): clean_up_test_db(cls.test_db)