betodealmeida commented on a change in pull request #11332:
URL:
https://github.com/apache/incubator-superset/pull/11332#discussion_r508942139
##########
File path: tests/datasets/api_tests.py
##########
@@ -1006,6 +1008,68 @@ def test_export_dataset_gamma(self):
rv = self.client.get(uri)
self.assertEqual(rv.status_code, 401)
+ @patch.dict(
+ "superset.extensions.feature_flag_manager._feature_flags",
+ {"VERSIONED_EXPORT": True},
+ clear=True,
+ )
+ def test_export_dataset_bundle(self):
+ """
+ Dataset API: Test export dataset
+ """
+ birth_names_dataset = self.get_birth_names_dataset()
+ # TODO: fix test for presto
+ # debug with dump:
https://github.com/apache/incubator-superset/runs/1092546855
+ if birth_names_dataset.database.backend in {"presto", "hive"}:
+ return
+
+ argument = [birth_names_dataset.id]
+ uri = f"api/v1/dataset/export/?q={prison.dumps(argument)}"
+
+ self.login(username="admin")
+ rv = self.get_assert_metric(uri, "export")
+
+ assert rv.status_code == 200
+
+ buf = BytesIO(rv.data)
+ assert is_zipfile(buf)
Review comment:
We're favoring using `asserts` instead of `self.assertEqual` since
that's the recommended approach for pytest:
https://docs.pytest.org/en/stable/assert.html
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]