Selaa lähdekoodia

HUE-8747 [editor] Fix sql_utils_test.test_split_statements

jdesjean 6 vuotta sitten
vanhempi
commit
94bf7dc0e0
1 muutettua tiedostoa jossa 8 lisäystä ja 8 poistoa
  1. 8 8
      desktop/libs/notebook/src/notebook/sql_utils_test.py

+ 8 - 8
desktop/libs/notebook/src/notebook/sql_utils_test.py

@@ -15,18 +15,18 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
-from notebook.sql_utils import strip_trailing_semicolon
+from beeswax.design import hql_query
+from notebook.sql_utils import strip_trailing_semicolon, split_statements
 
 from nose.tools import assert_equal
 
 def test_split_statements():
-  assert_equal([''], ";;;")
-  assert_equal(["select * where id == '10'"], "select * where id == '10'")
-  assert_equal(["select * where id == '10'"], "select * where id == '10';")
-  assert_equal(['select', "select * where id == '10;' limit 100"], "select; select * where id == '10;' limit 100;")
-  assert_equal(['select', "select * where id == \"10;\" limit 100"], "select; select * where id == \"10;\" limit 100;")
-  assert_equal(['select', "select * where id == '\"10;\"\"\"' limit 100"], "select; select * where id == '\"10;\"\"\"' limit 100;")
+  assert_equal([''], hql_query(";;;").statements)
+  assert_equal(["select * where id == '10'"], hql_query("select * where id == '10'").statements)
+  assert_equal(["select * where id == '10'"], hql_query("select * where id == '10';").statements)
+  assert_equal(['select', "select * where id == '10;' limit 100"], hql_query("select; select * where id == '10;' limit 100;").statements)
+  assert_equal(['select', "select * where id == \"10;\" limit 100"], hql_query("select; select * where id == \"10;\" limit 100;").statements)
+  assert_equal(['select', "select * where id == '\"10;\"\"\"' limit 100"], hql_query("select; select * where id == '\"10;\"\"\"' limit 100;").statements)
 
 def teststrip_trailing_semicolon():
   # Note that there are two queries (both an execute and an explain) scattered