Я пишу pytest для метода, но сталкиваюсь с исключениями botocore, поскольку SecretID получает значение NULL, но ожидает значения от 0 до INF.
assert function_name(arguments) == [return value as list]
def foo(table_name):
try:
fieldlist = []
control_conn = self.dict_table()
table_name = table_name.strip('history_')
rspnse = control_conn.query(
KeyConditionExpression=Key('table_name').eq(table_name),
FilterExpression=Attr("Table Column Datatype").contains('NUMBER')
)
for i in rspnse['Items']:
fieldlist.append(i['Table Column Name'])
logging.info("Table Column Name" + str(i['Table Column Name']))
return fieldlist
Ниже приведен фрагмент ошибки
parameters = {'SecretId': ''}
operation_model = OperationModel(name=GetSecretValue)
def serialize_to_request(self, parameters, operation_model):
input_shape = operation_model.input_shape
if input_shape is not None:
report = self._param_validator.validate(parameters,
operation_model.input_shape)
if report.has_errors():
> raise ParamValidationError(report=report.generate_report())
E botocore.exceptions.ParamValidationError: Parameter validation failed:
E Invalid length for parameter SecretId, value: 0, valid range: 1-inf