AAfghahi commented on a change in pull request #13893:
URL: https://github.com/apache/superset/pull/13893#discussion_r608707041
##########
File path: tests/queries/saved_queries/api_tests.py
##########
@@ -745,3 +751,48 @@ def test_export_not_allowed(self):
uri = f"api/v1/saved_query/export/?q={prison.dumps(argument)}"
rv = self.client.get(uri)
assert rv.status_code == 404
+
+ def create_saved_query_import(self):
+ buf = BytesIO()
+ with ZipFile(buf, "w") as bundle:
+ with bundle.open("saved_query_export/metadata.yaml", "w") as fp:
+
fp.write(yaml.safe_dump(saved_queries_metadata_config).encode())
+ with bundle.open(
+ "saved_query_export/databases/imported_database.yaml", "w"
+ ) as fp:
+ fp.write(yaml.safe_dump(database_config).encode())
+ with
bundle.open("saved_query_export/queries/imported_database/public/imported_saved_query.yaml",
"w") as fp:
+ fp.write(yaml.safe_dump(saved_queries_config).encode())
+ buf.seek(0)
+ return buf
+
+ @pytest.mark.usefixtures("create_saved_queries")
Review comment:
that makes sense, sort of like a beforeEach afterEach in RTL. Would it
be more thorough to add this fixture?
--
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]