Iโm not 100% clear on what youโre asking for here, but I think you want to see, outside the module what is being passed into json_content to then use it in an external test?
If this is the case then, in this instance, I would probably do the following:
Use a local variable to hold the output of the templatefile()
Reference that local as the value of your json_content
either
3a. Use an output to expose the local value directly to outside the module and process as required. or
3b. use the local_file Resource and set the content of that resource to the local variable to write it out as a file which could then be used as an artefact as part of the testing.