I am building a testing framework and have outputs going into folder structures. I would like to verify if these outputs fit a certain schema at the point at which I generate the filename.
Example schema:
test_<output_type>_<folder_type>_<int>.json
Example output:
test_outputabc_success_0.json
The output_type and folder_type are strings, whilst the int can be any real number (however, in reality won't be larger than 1000.)
I have looked into and implemented things such as endswith('.json') and startswith('test_').
I could use replace() method to check different parts, which I will do if there is nothing better. I think I can use isdigit() as well to check the integer.
I am not very familiar with regex, but expect that could help.
Any ideas on a simple way to verify the entire string which doesn't involve checking these one-by-one? I am happy to create a dictionary or lists which include all possible acceptable sub-strings.
Thanks!