Пример #1
0
 def test_load_fcn_querystring_fmt(self, queries_file):
     parsed = load_queries(queries_file)
     fcn = parsed[0][2]
     assert fcn.__query__ == """select *
Пример #2
0
 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)
Пример #3
0
 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'
Пример #4
0
 def test_load_fcn_name(self, queries_file):
     parsed = load_queries(queries_file)
     fcn = parsed[0][2]
     assert fcn.__name__ == 'TEST_SELECT'
Пример #5
0
 def test_load_fcn(self, queries_file):
     parsed = load_queries(queries_file)
     assert isinstance(parsed[0][2], functools.partial)
Пример #6
0
 def test_load_name(self, queries_file):
     parsed = load_queries(queries_file)
     assert parsed[0][0] == 'TEST_SELECT'
Пример #7
0
 def test_load_arr(self, queries_file_arr):
     parsed = load_queries(queries_file_arr)
     assert isinstance(parsed, list)