python-specfor 0.1.0

A Framework for Behavior Driven Development(BDD) based on stdlib's unittest
python-specfor is inspired from Ruby's RSpec. Spec definition is based on Python decorator description.

Spec Example

# spec_sum.py
from specfor import the, spec

empty_list = spec.of("empty list")
int_list = spec.of("int list")

@empty_list.before()
def prepare(its):
 its.list = []
 its.sum = 0

@int_list.before()
def prepare(its):
 its.list = [2, 3, 5, 7, 11]
 its.sum = 28

@empty_list.that("sum")
@int_list.that("sum")
def sum_spec(its):
 result = sum(its.list)
 the[result].should == its.sum

spec.publish(globals())

Main features:

  • Decorator based Spec definition
  • "Spec" definition is compatible with unittest.TestCase
  • Spec files can execute with unittest/nose
  • Markdown document generator from spec file
  • RSpec like Expectation (e.g. the[xxx].should.be yyy)
  • Decorator based Mock generator

last updated on:
August 7th, 2010, 4:20 GMT
price:
FREE!
developed by:
bellbind
homepage:
github.com
license type:
LGPL (GNU Lesser General Public License) 
category:
ROOT \ Programming \ Quality Assurance and Testing

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Rate it!

Add your review!

SUBMIT