diff --git a/tableauserverclient/__init__.py b/tableauserverclient/__init__.py index 7241f23ca..cb197d47c 100644 --- a/tableauserverclient/__init__.py +++ b/tableauserverclient/__init__.py @@ -67,6 +67,10 @@ RequestOptions, MissingRequiredFieldError, FailedSignInError, + FlowRunCancelledException, + FlowRunFailedException, + JobCancelledException, + JobFailedException, NotSignedInError, ServerResponseError, Filter, @@ -98,6 +102,8 @@ "FileuploadItem", "Filter", "FlowItem", + "FlowRunCancelledException", + "FlowRunFailedException", "FlowRunItem", "get_versions", "GroupItem", @@ -105,6 +111,8 @@ "HourlyInterval", "ImageRequestOptions", "IntervalItem", + "JobCancelledException", + "JobFailedException", "JobItem", "JWTAuth", "LinkedTaskFlowRunItem", diff --git a/tableauserverclient/server/__init__.py b/tableauserverclient/server/__init__.py index 55288fdc9..44020419b 100644 --- a/tableauserverclient/server/__init__.py +++ b/tableauserverclient/server/__init__.py @@ -12,7 +12,14 @@ from tableauserverclient.server.sort import Sort from tableauserverclient.server.server import Server from tableauserverclient.server.pager import Pager -from tableauserverclient.server.endpoint.exceptions import FailedSignInError, NotSignedInError +from tableauserverclient.server.endpoint.exceptions import ( + FailedSignInError, + FlowRunCancelledException, + FlowRunFailedException, + JobCancelledException, + JobFailedException, + NotSignedInError, +) from tableauserverclient.server.endpoint import ( Auth, @@ -60,6 +67,10 @@ "Server", "Pager", "FailedSignInError", + "FlowRunCancelledException", + "FlowRunFailedException", + "JobCancelledException", + "JobFailedException", "NotSignedInError", "Auth", "CustomViews", diff --git a/test/test_import_surface.py b/test/test_import_surface.py new file mode 100644 index 000000000..d2069aa64 --- /dev/null +++ b/test/test_import_surface.py @@ -0,0 +1,16 @@ +import tableauserverclient as TSC +from tableauserverclient.server.endpoint import exceptions + + +def test_job_exceptions_at_top_level(): + assert TSC.JobFailedException is exceptions.JobFailedException + assert TSC.JobCancelledException is exceptions.JobCancelledException + assert "JobFailedException" in TSC.__all__ + assert "JobCancelledException" in TSC.__all__ + + +def test_flow_run_exceptions_at_top_level(): + assert TSC.FlowRunFailedException is exceptions.FlowRunFailedException + assert TSC.FlowRunCancelledException is exceptions.FlowRunCancelledException + assert "FlowRunFailedException" in TSC.__all__ + assert "FlowRunCancelledException" in TSC.__all__