summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2012-05-09 21:00:53 +0200
committerAndoni Morales Alastruey <ylatuya@gmail.com>2012-05-09 21:02:21 +0200
commit7ab46610356871f2e4d4e77e43d9f4d9e90817f0 (patch)
treed97862facf5ca8db870a569d123df849fda8bc35 /test
parent3faf301940af4ebe638639d8f9f7b85426bd5b5b (diff)
test: update tests for the cookbook
Diffstat (limited to 'test')
-rw-r--r--test/test_cerbero_build_cookbook.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_cerbero_build_cookbook.py b/test/test_cerbero_build_cookbook.py
index d7080872..19c8b493 100644
--- a/test/test_cerbero_build_cookbook.py
+++ b/test/test_cerbero_build_cookbook.py
@@ -99,3 +99,23 @@ class PackageTest(unittest.TestCase):
self.cookbook.update_step_status(recipe.name, 'install')
status = self.cookbook._recipe_status(recipe.name)
self.assertEquals(status.steps, ['fetch', 'build', 'install'])
+ for step in ['fetch', 'build', 'install']:
+ self.assertTrue(self.cookbook.step_done(recipe.name, step))
+
+ def testBuildStatus(self):
+ recipe = Recipe1(self.config)
+ self.cookbook.add_recipe(recipe)
+ self.cookbook._restore_cache()
+ self.cookbook.update_build_status(recipe.name, True)
+ self.assertTrue(self.cookbook.status[recipe.name].needs_build)
+ self.cookbook.update_build_status(recipe.name, False)
+ self.assertFalse(self.cookbook.status[recipe.name].needs_build)
+
+ def testResetRecipeStatus(self):
+ recipe = Recipe1(self.config)
+ self.cookbook.add_recipe(recipe)
+ self.cookbook._restore_cache()
+ self.cookbook.reset_recipe_status(recipe.name)
+ status = self.cookbook._recipe_status(recipe.name)
+ self.assertEquals(status.steps, [])
+ self.assertTrue(self.cookbook.status[recipe.name].needs_build)