Have an automated test using robot framework to check for the presence of certain file types.
Up to now we've only been checking for .crt files, but I now need to check for either .crt or .pem files.
The check itself should be for either or both.
This is my current code:
${certs}= SSHLibrary.List Files In Directory ${cert_file_path} *.crt
What's the easiest way to check for both the crt and pem file types in a single test?
@{tmp}= List Files In Directory ${cert_file_path}
@{files}= Evaluate list(filter(lambda x: x.endswith(('.crt', '.pem')), ${tmp}))
And then you change the ('.crt', '.pem')
into extensions you like. Downside of this is that you are fetching all the filenames in the cert_file_path and doing the filtering on the robot side.. But at least it works.