StackStorm/st2 — pull request #793 by lakshmi-kannan (2014-11-14 01:52:23+00:00)
Title: WIP: A generic fixtures loader for loading fixtures from files. 

## What?

We basically want to move all models being defined repetitively in tests to a more sane approach where these models are available as fixtures and each test selectively saves them to db and deletes them when tests are done.

## Why?

Less code duplication. Also, we'll have plenty of JSON/YAML samples for rules, actions, etc.

## How?

All generic fixtures that can be shared across tests should be placed in
st2tests/fixtures/generic
actions/
rules/
executions/

If you really want specific fixtures for a test, you can create a fixture_pack with same structure but under a different root. Example: st2tests/fixtures/myspecialtest

## Note

There are some fixtures that don't have data models. Examples are actionchains and workflows. Those are loaded using load_fixtures.

I am still thinking through these. There are data model models that I might have skipped but adding them is easy and localized to one file: fixturesloader.py.

Have a look at aceb37e to see how this is beneficial. The test is more sane now.