Example #1
0
File: tests.py Project: yab/Archery
 def test_query_check_disable_sql(self):
     sql = "update xxx set a=1 "
     new_engine = OracleEngine(instance=self.ins)
     check_result = new_engine.query_check(db_name='archery', sql=sql)
     self.assertDictEqual(check_result,
                          {'msg': '仅支持^select语法!', 'bad_query': True, 'filtered_sql': sql.strip(),
                           'has_star': False})
Example #2
0
File: tests.py Project: yab/Archery
 def test_query_check_star_sql(self):
     sql = "select * from xx "
     new_engine = OracleEngine(instance=self.ins)
     check_result = new_engine.query_check(db_name='archery', sql=sql)
     self.assertDictEqual(check_result,
                          {'msg': '禁止使用 * 关键词\n', 'bad_query': False, 'filtered_sql': sql.strip(), 'has_star': True})