test run_recipe

This commit is contained in:
Michael Stephens 2010-06-30 15:31:30 -04:00
parent a0d3010c0c
commit e8ce9948de

View File

@ -1,6 +1,6 @@
import doctest import doctest
import unittest import unittest
from saucebrush import Recipe from saucebrush import Recipe, run_recipe
from saucebrush.filters import Filter from saucebrush.filters import Filter
@ -23,10 +23,17 @@ class RecipeTestCase(unittest.TestCase):
saver = Saver() saver = Saver()
recipe = Recipe(Raiser(), error_stream=saver) recipe = Recipe(Raiser(), error_stream=saver)
recipe.run([{'a': 1}, {'b': 2}]) recipe.run([{'a': 1}, {'b': 2}])
recipe.done()
self.assertEqual(saver.saved[0]['record'], {'a': 1}) self.assertEqual(saver.saved[0]['record'], {'a': 1})
self.assertEqual(saver.saved[1]['record'], {'b': 2}) self.assertEqual(saver.saved[1]['record'], {'b': 2})
def test_run_recipe(self):
saver = Saver()
run_recipe([1, 2], saver)
self.assertEqual(saver.saved, [1, 2])
def test_done(self): def test_done(self):
saver = Saver() saver = Saver()
recipe = Recipe(saver) recipe = Recipe(saver)