Skip to content

Commit

Permalink
feat: add unit test for LimitMethod.FETCH_MANY (#13364)
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida authored Mar 1, 2021
1 parent 36fda5e commit 08183df
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/db_engine_specs/base_engine_spec_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
import pytest

from superset.db_engine_specs import engines
from superset.db_engine_specs.base import BaseEngineSpec, builtin_time_grains
from superset.db_engine_specs.base import (
BaseEngineSpec,
builtin_time_grains,
LimitMethod,
)
from superset.db_engine_specs.sqlite import SqliteEngineSpec
from superset.sql_parse import ParsedQuery
from superset.utils.core import get_example_database
Expand Down Expand Up @@ -154,6 +158,14 @@ def test_limit_with_non_token_limit(self):
"""SELECT 'LIMIT 777'""", """SELECT 'LIMIT 777'\nLIMIT 1000"""
)

def test_limit_with_fetch_many(self):
class DummyEngineSpec(BaseEngineSpec):
limit_method = LimitMethod.FETCH_MANY

self.sql_limit_regex(
"SELECT * FROM table", "SELECT * FROM table", DummyEngineSpec
)

def test_time_grain_denylist(self):
with app.app_context():
app.config["TIME_GRAIN_DENYLIST"] = ["PT1M"]
Expand Down

0 comments on commit 08183df

Please sign in to comment.