Skip to content

Commit 84542a9

Browse files
author
Ilyas Gasanov
committed
[DOP-21442] Add Excel API schema
1 parent 6086576 commit 84542a9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tests/test_unit/test_transfers/test_create_transfer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,14 @@ async def test_developer_plus_can_not_create_transfer_with_target_format_json(
633633
"message": "Invalid request",
634634
"details": [
635635
{
636-
"context": {"discriminator": "'type'", "tag": "json", "expected_tags": "'csv', 'jsonline'"},
636+
"context": {
637+
"discriminator": "'type'",
638+
"tag": "json",
639+
"expected_tags": "'csv', 'jsonline', 'excel'",
640+
},
637641
"input": {"type": "json", "lineSep": "\n", "encoding": "utf-8"},
638642
"location": ["body", "target_params", "s3", "file_format"],
639-
"message": "Input tag 'json' found using 'type' does not match any of the expected tags: 'csv', 'jsonline'",
643+
"message": "Input tag 'json' found using 'type' does not match any of the expected tags: 'csv', 'jsonline', 'excel'",
640644
"code": "union_tag_invalid",
641645
},
642646
],

tests/test_unit/test_transfers/test_file_transfers/test_create_transfer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ async def test_developer_plus_can_create_s3_transfer(
114114

115115
expected_file_formats = {
116116
"csv": {
117+
"type": "csv",
117118
"delimiter": ",",
118119
"encoding": "utf-8",
119120
"quote": '"',
@@ -122,6 +123,7 @@ async def test_developer_plus_can_create_s3_transfer(
122123
"line_sep": "\n",
123124
},
124125
"excel": {
126+
"type": "excel",
125127
"include_header": True,
126128
"start_cell": "A1",
127129
},
@@ -131,7 +133,7 @@ async def test_developer_plus_can_create_s3_transfer(
131133
assert params["type"] == target_source_params["type"]
132134
assert params["directory_path"] == target_source_params["directory_path"]
133135
assert params["options"] == {"some": "option"}
134-
assert params["file_format"] == expected_file_formats[params["type"]]
136+
assert params["file_format"] == expected_file_formats[params["file_format"]["type"]]
135137

136138

137139
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)