Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ def apply_pdf_options(logger, request_options: TSC.PDFRequestOptions, args):
request_options.orientation = args.pagelayout
if args.pagesize:
request_options.page_type = args.pagesize
if args.height:
request_options.viz_height = int(args.height)
if args.width:
request_options.viz_width = int(args.width)

@staticmethod
def save_to_data_file(logger, output, filename):
Expand Down
6 changes: 6 additions & 0 deletions tests/commands/test_datasources_and_workbooks_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,18 @@ def test_apply_png_options_bad_values(self):
def test_apply_pdf_options(self):
expected_page = tsc.PDFRequestOptions.PageType.Folio.__str__()
expected_layout = tsc.PDFRequestOptions.Orientation.Portrait.__str__()
expected_height = 800
expected_width = 600
mock_args.pagelayout = expected_layout
mock_args.pagesize = expected_page
mock_args.height = expected_height
mock_args.width = expected_width
request_options = tsc.PDFRequestOptions()
DatasourcesAndWorkbooks.apply_pdf_options(mock_logger, request_options, mock_args)
assert request_options.page_type == expected_page
assert request_options.orientation == expected_layout
assert request_options.viz_width == expected_width
assert request_options.viz_height == expected_height


@mock.patch("tableauserverclient.Server")
Expand Down