Skip to content

Commit

Permalink
Fix typo and use tempfile to generated test output file.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbernstein committed Sep 25, 2023
1 parent 0a360cc commit 0baa75f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions core/operation/import_from_json_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ def __init__(
self._template_name = template_name
self._target_namespace = target_namespace
self._data_source_arn = data_source_arn
self._intput_dir = input_dir
self._input_dir = input_dir
super().__init__(*args, **kwargs)

def execute(self) -> dict:
# Read template file into dictionary
template_data = None
template_file = self._resolve_path(
self._intput_dir, TEMPLATE_DIR, self._template_name + ".json"
self._input_dir, TEMPLATE_DIR, self._template_name + ".json"
)
with open(template_file) as template_file:
template_data = json.loads(template_file.read())
Expand All @@ -56,7 +56,7 @@ def execute(self) -> dict:
dataset = None
placeholder = di["Placeholder"]
dataset_filename = self._resolve_path(
self._intput_dir, DATA_SET_DIR, placeholder + ".json"
self._input_dir, DATA_SET_DIR, placeholder + ".json"
)
with open(dataset_filename) as dataset_file:
dataset = json.loads(dataset_file.read())
Expand Down
3 changes: 2 additions & 1 deletion tests/core/operation/test_export_analysis_operation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import tempfile

import botocore
from botocore.config import Config
Expand All @@ -18,7 +19,7 @@
class TestExportAnalysisOperation:
def test(self):
analysis_id = "my-quicksight-analysis-id"
output_dir = "/tmp/test-output"
output_dir = tempfile.NamedTemporaryFile().name
account = "012345678910"

boto_config = Config(
Expand Down

0 comments on commit 0baa75f

Please sign in to comment.