def test_load_fcn_querystring_fmt(self, queries_file): parsed = load_queries(queries_file) fcn = parsed[0][2] assert fcn.__query__ == """select *
def test_load_exception(self, invalid_file_path): exc_msg = "[Errno No such file or directory] Could not find file: '{}'"\ .format(invalid_file_path) with pytest.raises(SQLLoadException, message=exc_msg): load_queries(invalid_file_path)
def test_load_fcn_doc(self, queries_file): parsed = load_queries(queries_file) fcn = parsed[0][2] assert fcn.__doc__ == 'testing the sqlpi module pls work\nsecond line comment'
def test_load_fcn_name(self, queries_file): parsed = load_queries(queries_file) fcn = parsed[0][2] assert fcn.__name__ == 'TEST_SELECT'
def test_load_fcn(self, queries_file): parsed = load_queries(queries_file) assert isinstance(parsed[0][2], functools.partial)
def test_load_name(self, queries_file): parsed = load_queries(queries_file) assert parsed[0][0] == 'TEST_SELECT'
def test_load_arr(self, queries_file_arr): parsed = load_queries(queries_file_arr) assert isinstance(parsed, list)