I am currently trying to unit test a module that parses and validates an XML file against a .XSD schema that I created. I want to be able to test a bunch of different XML files, but don't want to have to make a bunch of different XMLs. I was wondering if there is a way to simply use a string to create a File object that can be passed into the function I am testing.
An example might be:
File('<test><text>This is a test xml file used for testing</text></test>')
I just don't know the exact syntax to do it and can't find it. Thanks!
io.StringIO