You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Factory function to generate TDF files for a specific target mode.
129
-
130
-
Args:
131
-
target_mode: Target TDF spec version (e.g., "v4.2.2", "v4.3.1")
132
-
temp_credentials_file: Path to credentials file
133
-
test_data_dir: Base test data directory
134
-
sample_input_files: Dictionary of sample input files
135
-
136
-
Returns:
137
-
Dictionary mapping file types to their TDF file paths
138
-
"""
139
-
output_dir=test_data_dir/target_mode
140
-
tdf_files= {}
141
-
142
-
# Define the file generation configurations
143
-
file_configs= [
144
-
{
145
-
"key": "text",
146
-
"input_key": "text",
147
-
"output_name": "sample_text.txt.tdf",
148
-
"mime_type": "text/plain",
149
-
},
150
-
# {
151
-
# "key": "empty",
152
-
# "input_key": "empty",
153
-
# "output_name": "empty_file.txt.tdf",
154
-
# "mime_type": "text/plain",
155
-
# },
156
-
{
157
-
"key": "binary",
158
-
"input_key": "binary",
159
-
"output_name": "sample_binary.png.tdf",
160
-
"mime_type": "image/png",
161
-
},
162
-
{
163
-
"key": "with_attributes",
164
-
"input_key": "with_attributes",
165
-
"output_name": "sample_with_attributes.txt.tdf",
166
-
"mime_type": "text/plain",
167
-
},
168
-
]
169
-
170
-
try:
171
-
forconfiginfile_configs:
172
-
tdf_path=output_dir/config["output_name"]
173
-
_generate_target_mode_tdf(
174
-
sample_input_files[config["input_key"]],
175
-
tdf_path,
176
-
target_mode,
177
-
temp_credentials_file,
178
-
# attributes=[CONFIG_TDF.TEST_OPENTDF_ATTRIBUTE_1] if config["key"] == "with_attributes" else None, # Temporarily disabled due to external KAS dependency
0 commit comments