Exemplo n.º 1
0
    def get(self):
        # validate access token
        if not self.ValidateToken():
            return

        idd = self.get_argument("id", "")
        product_list = self.get_argument("products", "")

        cellar = Cellar()
        cellar.InitWithId(idd)

        # self.write(cellar.RemoveProducts(product_list))
        pass
Exemplo n.º 2
0
def addTesting(add_data):
    print "\nrunning /cellar/add testing"
    add_url = ws_url + "cellar/add?" + urllib.urlencode(add_data)
    add_results = urllib.urlopen(add_url).read()

    cellar = Cellar()
    cellar.InitWithId(add_results, db.cellar)

    #print "results : " + cellar.name
    if cellar.name == add_data["name"]:
        print "ok"
    else:
        print "failed"
    print "testing results: " + add_results

    return add_results
Exemplo n.º 3
0
def editTesting(add_results, edit_data):
    print "\nrunning /cellar/edit testing"

    edit_data["id"] = add_results

    print "edit id: " + edit_data["id"]

    edit_url = ws_url + "cellar/edit?" + urllib.urlencode(edit_data)
    edit_results = urllib.urlopen(edit_url).read()

    cellar = Cellar()
    cellar.InitWithId(edit_results, db.cellar)

    print "cellar id: " + str(cellar.identifier)

    #print "testing results : " + cellar.name
    if cellar.name == edit_data["name"] and cellar.identifier == edit_data[
            "id"]:
        print "ok"
    else:
        print "failed"

    return edit_results