Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a simple variable replacement templating syntax for fixtures #8

Open
croach opened this issue Dec 22, 2014 · 1 comment
Open

Add a simple variable replacement templating syntax for fixtures #8

croach opened this issue Dec 22, 2014 · 1 comment

Comments

@croach
Copy link
Owner

croach commented Dec 22, 2014

In several situations, the developer has added constants to their code that the test test writer would like to reference in the tests. Doing so allows tests to remain unchanged when changes to the value of said constants happen in the codebase. This feature would add a pre-processing step to the ingestion of fixture files that would allow test writers to reference variables within python modules.

For example,

- table: employees
  records:
    - id: 1
      name: Winston Smith
      email: #{ oceania.models.WINSTON_SMITH_EMAIL }
{
    "table": "employees",
    "records": [{
        "id": 1,
        "name": "Winston Smith",
        "email": "#{ oceania.models.WINSTON_SMITH_EMAIL }"
    }]
}
@guyskk
Copy link

guyskk commented Feb 6, 2016

Another lib named fixture http://farmdev.com/projects/fixture/using-dataset.html support this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants