Skip to content

Commit

Permalink
Add missing request fixture to array contains tests (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantAnxiety authored Oct 24, 2023
1 parent 3624863 commit ad03ba8
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ def test_duplicated_expressions(
ds.result_schema["Measure 1"] = ds.field(formula=f"SUM([{data_api_test_params.summable_field}])")
ds.result_schema["Measure 2"] = ds.field(formula=f"SUM([{data_api_test_params.summable_field}])")

result_resp = self.get_result(ds, data_api, field_names=(
"Measure 1", "Measure 2", data_api_test_params.two_dims[0]
))
result_resp = self.get_result(
ds, data_api, field_names=("Measure 1", "Measure 2", data_api_test_params.two_dims[0])
)
rows = get_data_rows(result_resp)
min_row_cnt = 2 # just an arbitrary number
assert len(rows) > min_row_cnt
assert all(row[0] == row[1] for row in rows)

def _test_contains(
self,
request,
request: pytest.FixtureRequest,
db: Db,
saved_connection_id: str,
dataset_params: dict,
Expand Down Expand Up @@ -142,27 +142,29 @@ def check_filter(field_title: str, filter_value: Any) -> None:
@for_features(array_support)
def test_array_contains_filter(
self,
request: pytest.FixtureRequest,
db: Db,
saved_connection_id: str,
dataset_params: dict,
control_api: SyncHttpDatasetApiV1,
data_api: SyncHttpDataApiV2,
) -> None:
self._test_contains(
db, saved_connection_id, dataset_params, control_api, data_api, WhereClauseOperation.CONTAINS
request, db, saved_connection_id, dataset_params, control_api, data_api, WhereClauseOperation.CONTAINS
)

@for_features(array_support)
def test_array_not_contains_filter(
self,
request: pytest.FixtureRequest,
db: Db,
saved_connection_id: str,
dataset_params: dict,
control_api: SyncHttpDatasetApiV1,
data_api: SyncHttpDataApiV2,
) -> None:
self._test_contains(
db, saved_connection_id, dataset_params, control_api, data_api, WhereClauseOperation.NOTCONTAINS
request, db, saved_connection_id, dataset_params, control_api, data_api, WhereClauseOperation.NOTCONTAINS
)

@pytest.mark.parametrize(
Expand All @@ -179,7 +181,7 @@ def test_array_not_contains_filter(
@for_features(array_support)
def test_array_contains_field(
self,
request,
request: pytest.FixtureRequest,
db: Db,
saved_connection_id: str,
dataset_params: dict,
Expand Down Expand Up @@ -409,7 +411,7 @@ def test_distinct_with_nonexistent_filter(

def test_date_filter_distinct(
self,
request,
request: pytest.FixtureRequest,
db: Db,
saved_connection_id: str,
dataset_params: dict,
Expand Down

0 comments on commit ad03ba8

Please sign in to comment.