There is something like Ruby Machinist for Python

Copied from http://github.com/notahat/machinist/

The machinist makes it easy to create test data in your tests. It generates data for fields you don't need and creates any related objects you need, leaving you to specify only the fields you need in your tests

A simple diagram might look like this:

Post.blueprint do
  title {Sham.title}
  author {Sham.name}
  body {Sham.body}
end

Then you can create a post from this plan with:

Post.make

When you call make, the typist calls Post.new, then runs through the attributes in your project, calling a block for each attribute to generate a value. Then Mail is saved and reloaded. An exception is thrown if the message cannot be saved.

+2


source to share


1 answer


I have looked through the entire Python Tools Taxonomy page (which has a lot of great stuff) but didn't find anything similar to the MACHINIST.



There is one simple script (called Peckcheck ) that is basically unit testing with data generation, but it doesn't "you have Blueprinting, etc, so you can say it's just Sham :)

+1


source







All Articles