def test_update_user(api): data = { "username": "******", "firstname": "Blossom", "lastname": "Utonium", "password1": "ng5qhhbiwozcANc3", "password2": "ng5qhhbiwozcANc3", "email": "*****@*****.**", "timezone": "Africa/Johannesburg", "account_type": "3", "domains": "9", "active": "y", "send_report": "y", "spam_checks": "y", "low_score": "5.0", "high_score": "10.0", } req = api.update_user(data) path = ENDPOINTS["users"]["update"]["name"] t.eq(api.response.final_url, "%s%s%s" % (BASE_URL, API_PATH, path)) t.eq(api.response.request.method, ENDPOINTS["users"]["update"]["method"]) t.eq(api.response.status_int, 201) t.eq(req["low_score"], "5.0") t.eq(req["high_score"], "10.0") t.isnotin("password1", req)
def test_py_del_global(rt): glbl = ActiveGlobalWithDel() cx = rt.new_context(glbl) cx.execute("foo = 4;") t.eq(glbl.data["foo"], 8) cx.execute("delete foo;") t.isnotin("foo", glbl.data)
def test_003(o, u, b): r = request(u, "POST", body=b, filters=[o], headers={"Content-type": "application/x-www-form-urlencoded"}) import sys print >>sys.stderr, r.body_string() t.eq(r.status_int, 200) # Because this is a POST and an application/x-www-form-urlencoded, the OAuth # can include the OAuth parameters directly into the body of the form, however # it MUST NOT include the 'oauth_body_hash' parameter in these circumstances. t.isnotin("oauth_body_hash", r.request.body)
def test_update_alias(api): addressid = 3 data = {"address": "*****@*****.**"} req = api.update_alias(addressid, data) path = ENDPOINTS["aliases"]["update"]["name"] % dict(addressid=addressid) t.eq(api.response.final_url, "%s%s%s" % (BASE_URL, API_PATH, path)) t.eq(api.response.request.method, ENDPOINTS["aliases"]["update"]["method"]) t.eq(api.response.status_int, 200) t.isnotin("enabled", req) t.eq(req["address"], "*****@*****.**")
def test_003(o, u, b): r = request(u, "POST", body=b, filters=[o], headers={"Content-type": "application/x-www-form-urlencoded"}) import sys print >> sys.stderr, r.body_string() t.eq(r.status_int, 200) # Because this is a POST and an application/x-www-form-urlencoded, the OAuth # can include the OAuth parameters directly into the body of the form, however # it MUST NOT include the 'oauth_body_hash' parameter in these circumstances. t.isnotin("oauth_body_hash", r.request.body)
def test_clear_excludes(): fl = t.FileList("*") t.isnotin("CVS", fl) t.isnotin(".svn", fl) t.isnotin(".dummy", fl) t.isnotin("x.bak", fl) t.isnotin("x~", fl) t.isnotin("core", fl)