def test_add_recipe_2(self):
   #This is test for adding recipe by commend line
   #specifically, the commend line is in the format of:
   #<recipe_name (liquor,amount) (liquor2,amount2) ...etc>
   #This one is to test the recipe with multi liquor
   commend = '<scotch on the rocks  (blended scotch,4 oz) (vodka,4 oz)>'
   test_load_recipe.load_recipe(commend)
 def test_add_recipe_3(self):
   #This is test for adding recipe by commend line
   #specifically, the commend line is in the format of:
   #<recipe_name (liquor,amount) (liquor2,amount2) ...etc>
   #This one is to test multi recipes input in one command line
   commend = '<scotch on the rocks  (blended scotch,4 oz) (vodka,4 oz)> <vodka martini  (unflavored vodka,6  oz) (vermouth, 1.5 oz)>'
   test_load_recipe.load_recipe(commend)    
Exemple #3
0
    def rpc_enter_recipes_result(self, environ, start_response):
	# this sets up jinja2 to load templates from the 'templates' directory
	loader = jinja2.FileSystemLoader('./templates')
	env = jinja2.Environment(loader=loader)
	
        formdata = environ['QUERY_STRING']
        results = urlparse.parse_qs(formdata)
	
        recipe = results['Input'][0]
        test_load_recipe.load_recipe(recipe)
        
        filename = 'form_result.html'
	vars = dict(input_type = 'recipes', direction = direction)
	
	template = env.get_template(filename)
        start_response('200 OK', list(html_headers))
        return str(template.render(vars))
 def test_add_recipe_1(self):
   #This is test for adding recipe by commend line
   #specifically, the commend line is in the format of:
   #<recipe_name (liquor,amount) (liquor2,amount2) ...etc>
   commend = '<scotch on the rocks, (blended scotch,4 oz)>'
   test_load_recipe.load_recipe(commend)