Skip to content

Commit

Permalink
test suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
AAfghahi committed Mar 17, 2022
1 parent ed4a851 commit 59bc37d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 35 deletions.
2 changes: 1 addition & 1 deletion UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ assists people when migrating to a new version.
- [18970](https://github.com/apache/superset/pull/18970): Changes feature
flag for the legacy datasource editor (DISABLE_LEGACY_DATASOURCE_EDITOR) in config.py to True, thus disabling the feature from being shown in the client.
- [19017](https://github.com/apache/superset/pull/19017): Removes Python 3.7 support.
- [19142](https://github.com/apache/superset/pull/19142): Changes feature flag for versioned export(VERSIONED_EXPORT) to be true, depreciating older api endpoints.
- [19142](https://github.com/apache/superset/pull/19142): Changes feature flag for versioned export(VERSIONED_EXPORT) to be true.

### Potential Downtime

Expand Down
1 change: 0 additions & 1 deletion tests/integration_tests/cli_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def test_export_datasources_original(app_context, fs):
)

assert response.exit_code == 0
# this api is deprecated, so it shows a response of 1 instead of 0

assert Path("datasources.yaml").exists()

Expand Down
24 changes: 6 additions & 18 deletions tests/integration_tests/dashboards/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,11 @@ def test_update_dashboard_not_owned(self):
db.session.delete(user_alpha2)
db.session.commit()

@patch.dict(
"superset.extensions.feature_flag_manager._feature_flags",
{"VERSIONED_EXPORT": False},
clear=True,
)
@pytest.mark.usefixtures(
"load_world_bank_dashboard_with_slices",
"load_birth_names_dashboard_with_slices",
Expand All @@ -1346,9 +1351,7 @@ def test_export(self):
# freeze time to ensure filename is deterministic
with freeze_time("2020-01-01T00:00:00Z"):
rv = self.get_assert_metric(uri, "export")
headers = generate_download_headers(
"zip", "dashboard_export_20200101T000000"
)["Content-Disposition"]
headers = generate_download_headers("json")["Content-Disposition"]

assert rv.status_code == 200
assert rv.headers["Content-Disposition"] == headers
Expand Down Expand Up @@ -1378,11 +1381,6 @@ def test_export_not_allowed(self):
db.session.delete(dashboard)
db.session.commit()

@patch.dict(
"superset.extensions.feature_flag_manager._feature_flags",
{"VERSIONED_EXPORT": True},
clear=True,
)
def test_export_bundle(self):
"""
Dashboard API: Test dashboard export
Expand All @@ -1398,11 +1396,6 @@ def test_export_bundle(self):
buf = BytesIO(rv.data)
assert is_zipfile(buf)

@patch.dict(
"superset.extensions.feature_flag_manager._feature_flags",
{"VERSIONED_EXPORT": True},
clear=True,
)
def test_export_bundle_not_found(self):
"""
Dashboard API: Test dashboard export not found
Expand All @@ -1413,11 +1406,6 @@ def test_export_bundle_not_found(self):
rv = self.client.get(uri)
assert rv.status_code == 404

@patch.dict(
"superset.extensions.feature_flag_manager._feature_flags",
{"VERSIONED_EXPORT": True},
clear=True,
)
def test_export_bundle_not_allowed(self):
"""
Dashboard API: Test dashboard export not allowed
Expand Down
15 changes: 0 additions & 15 deletions tests/integration_tests/datasets/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1455,11 +1455,6 @@ def test_export_dataset_gamma(self):
rv = self.client.get(uri)
assert rv.status_code == 200

@patch.dict(
"superset.extensions.feature_flag_manager._feature_flags",
{"VERSIONED_EXPORT": True},
clear=True,
)
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_export_dataset_bundle(self):
"""
Expand All @@ -1482,11 +1477,6 @@ def test_export_dataset_bundle(self):
buf = BytesIO(rv.data)
assert is_zipfile(buf)

@patch.dict(
"superset.extensions.feature_flag_manager._feature_flags",
{"VERSIONED_EXPORT": True},
clear=True,
)
def test_export_dataset_bundle_not_found(self):
"""
Dataset API: Test export dataset not found
Expand All @@ -1499,11 +1489,6 @@ def test_export_dataset_bundle_not_found(self):

assert rv.status_code == 404

@patch.dict(
"superset.extensions.feature_flag_manager._feature_flags",
{"VERSIONED_EXPORT": True},
clear=True,
)
@pytest.mark.usefixtures("create_datasets")
def test_export_dataset_bundle_gamma(self):
"""
Expand Down

0 comments on commit 59bc37d

Please sign in to comment.