Exemplo n.º 1
0
	def test_message_list_to_json(self):
		recipes = []
		recipes.append(Recipe('A.md', MARKDOWN))
		recipes.append(Recipe('B.md', MARKDOWN))
		recipes.append(Recipe('C.md', MARKDOWN))
		recipes.append(Recipe('D.md', MARKDOWN))
		recipes.append(Recipe('E.md', MARKDOWN))
		json = recipes_to_json(recipes)
		self.assertIsNotNone(json)
Exemplo n.º 2
0
def list_recipes_with_content():
	try:
		recipes=[]
		recipe_names = app.storage.list()
		for recipe_name in recipe_names:
			recipes.append(app.storage.load(recipe_name))
		return recipes_to_json(recipes)
	except TassuException as error:
		app.logger.error(error)
		return json.dumps([])