Python
A module and its test in the folder where you run the blueprint.
Blueprint
Section titled “Blueprint”{ title: "Python module with a test", variables: [{ key: "name", prompt: "Module name" }], structure: { files: [ { name: "{name.snake}.py", content: [ "class {name.pascal}:", " def run(self) -> str:", ' return "{name.raw}"', ], }, { name: "test_{name.snake}.py", content: [ "from {name.snake} import {name.pascal}", "", "", "def test_run() -> None:", ' assert {name.pascal}().run() == "{name.raw}"', ], }, ], },}Result
Section titled “Result”With user service:
- user_service.py
- test_user_service.py
class UserService: def run(self) -> str: return "user service"from user_service import UserService
def test_run() -> None: assert UserService().run() == "user service"The file names use snake, the class uses pascal. Braces in Python code, for example in f-strings such as {value}, are not touched.