Exemplo n.º 1
0
	def test_loading_recipe(self):
		storage = RecipeStorage(TEST_DIRECTORY);

		recipe = Recipe('MustikkaPiirakka.md', MARKDOWN)				
		
		storage.save(recipe)
		recipe = storage.load('MustikkaPiirakka.md');

		self.assertEqual(recipe.name, 'MustikkaPiirakka.md','Recipe name should be MustikkaPiirakka.md')
		self.assertIsNotNone(recipe.markdown, 'Recipe should have some markdown on it.')
Exemplo n.º 2
0
	def test_list_file_history(self):
		storage = RecipeStorage(TEST_DIRECTORY);
		recipe = Recipe('MustikkaPiirakka.md', MARKDOWN)
		storage.save(recipe)
		storage.backup_recipe(recipe)
		time.sleep(1)
		storage.backup_recipe(recipe)
		recipe=storage.load('MustikkaPiirakka.md')
		recipes=storage.history(recipe)
		self.assertEqual(len(recipes),2)