Ejemplo n.º 1
0
def test_rpc_addrecipe_1():
	db._reset_db()
	text = call_remote(jsonrpc='1.0', method='addrecipe', params = ["gotdrunk", "Black Label,1234 ml, tommy, 5 gallon"], id='1')
	rpc_request = simplejson.loads(text)
	#print rpc_request
        result = rpc_request['result']
	print result
	assert "gotdrunk" in db.get_all_recipenames()
	testing = "Succesfully Added."
	assert result == testing
Ejemplo n.º 2
0
def test_rpc_addrecipe_2():
	#should fail, incorrect formatting
	db._reset_db()
	text = call_remote(jsonrpc='1.0', method='addrecipe', params = ["gotdrunk", "Black Label,1234 ml, tommy, 5 gallon,"], id='1')
	rpc_request = simplejson.loads(text)
	#print rpc_request
        result = rpc_request['result']
	print result
	assert "gotdrunk" not in db.get_all_recipenames()
	testing = "Incorrect format or incomplete. Please try again."
	assert result == testing
Ejemplo n.º 3
0
 def rpc_get_recipe_names(self):
     return db.get_all_recipenames()