+1 for DRYness On 9/12/13 7:41 AM, "Sowmya Krishnan" <sowmya.krish...@citrix.com> wrote:
>Data driven tests [1] help in generating more tests with less code. >Useful for cases where we have lot of similar tests to be carried out >with different configurations (run same tests with different network >offerings for example) > >I've tried this out for VPC tests. We have same set of tests need to be >run both for VPC created with "Default offering" and "Default Offering >with Netscaler as LB". Instead of rewriting the tests for each offering, >we could just use ddt (pip install ddt) to achieve it. > >I've pushed a VPC test suite here with the changes: >https://github.com/ksowmya/cloudstack-1/commit/67e8b3e43a8720d7887639498d6 >09aebce8e2935 >As part of this, I've also removed the creation of VPC offering as >discussed in the other thread. Rest of the changes are related to ddt. > >Please take a look and let me know if any comments/suggestions. I can >extend this further for other VPC tests and for other test suites as >well. Presently I can think of Persistent network tests as another >scenario where this might be useful. > >[1] http://ddt.readthedocs.org/en/latest/example.html (Thanks Prasanna >for the link!)