Open XiaoboHe opened 7 years ago
Hi! This is currently not supported. You need to put all initial rules into one file.
Is there any specific reason why you need multiple files in your situation?
in case, if there is a large number of mock interfaces which are provided different applications, how to manage the single config file with large size?
In my opinion, mock can be configured in diff files by diff dimensions.
You can work around this with your shell. For example, this works in Bash:
turq --no-editor --rules <( cat /data/*.py )
But maybe you’re right and Turq should be able to handle this by itself. I will think about this for the next version.
Hello vfaronov,
What about making imports in the rules file? Assuming the rules / file.py file The instruction: import rules.file
Thank you.
@wlyssespereira This will not work, because Turq rules are executed in a special Python scope (all the magic names like route
and GET
), which is unavailable to the module being imported.
Hello again vfaronov,
I made a little technical adjustment to solve this problem. Follow the code:
@wlyssespereira Thank you for your suggestion. But I don’t think messing with imports is a good idea for Turq. Above I showed how to load multiple Python files into Turq. If you need something more complex or strange, such as different modules, it’s likely that Turq just isn’t for you.
@vfaronov, I fully agree, thank you very much for the attention and congratulations for the project.
Hi vfaronov,
I just wonder how to start turq with multi-rule files? Thanks!
I start turq with command in the following, may be it is not supported.