# HG changeset patch
# User cmlenz
# Date 1123674298 0
# Node ID c2877512beb85c568681f3b9c448ff773f95af3b
# Parent 92e29e6b4c16448bacff994f1b4231f4ff7441b9
Additional unit test for the {{{bitten.recipe}}} module.
diff --git a/bitten/tests/recipe.py b/bitten/tests/recipe.py
--- a/bitten/tests/recipe.py
+++ b/bitten/tests/recipe.py
@@ -36,13 +36,29 @@
self.recipe_xml.close()
os.unlink(os.path.join(self.temp_dir, 'recipe.xml'))
- def test_description(self):
+ def test_empty_recipe(self):
self.recipe_xml.write(''
''
'')
self.recipe_xml.close()
recipe = Recipe(basedir=self.temp_dir)
self.assertEqual('test', recipe.description)
+ self.assertEqual(self.temp_dir, recipe.ctxt.basedir)
+ steps = list(recipe)
+ self.assertEqual(0, len(steps))
+
+ def test_single_step(self):
+ self.recipe_xml.write(''
+ ''
+ ' '
+ '')
+ self.recipe_xml.close()
+ recipe = Recipe(basedir=self.temp_dir)
+ steps = list(recipe)
+ self.assertEqual(1, len(steps))
+ self.assertEqual('foo', steps[0].id)
+ self.assertEqual('Bar', steps[0].description)
+ self.assertEqual('fail', steps[0].onerror)
def suite():