Created
February 15, 2011 04:09
-
-
Save gulopine/827082 to your computer and use it in GitHub Desktop.
Lab Coat: a "scientific" approach to testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from labcoat import specimen | |
from animals import Dog, Human | |
from house import Furniture | |
from animals.behavior.exceptions import BadDog | |
def test(): | |
with specimen(Dog) as rover: | |
rover.has.tail | |
rover.has(4).legs | |
rover.can.bark() | |
rover.s.fur_color == 'brown' | |
with specimen(Furniture) as couch: | |
couch.has(4).legs | |
couch.lacks.tail | |
couch.can_not.bark() | |
rover.can.hump(couch) | |
with specimen(Human) as owner: | |
owner.has(2).legs | |
owner.lacks.tail | |
rover.can_not.hump(owner).because(BadDog) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment