fixed when strings not initialized in prefs
parent
834aba85a6
commit
bf390f17dd
|
@ -89,9 +89,9 @@ class preferences:
|
||||||
get = HTTPPreferencesGET(url)
|
get = HTTPPreferencesGET(url)
|
||||||
get.cookie = self.cookie
|
get.cookie = self.cookie
|
||||||
self.client.execute(get)
|
self.client.execute(get)
|
||||||
if DEBUG: print "LUC (url):", url
|
if DEBUG: print "DEBUG (url):", url
|
||||||
if DEBUG: print "LUC (status):", get.response["status"]
|
if DEBUG: print "DEBUG (status):", get.response["status"]
|
||||||
if DEBUG: print "LUC (body):", get.response['body']
|
if DEBUG: print "DEBUG (body):", get.response['body']
|
||||||
content = simplejson.loads(get.response['body'])
|
content = simplejson.loads(get.response['body'])
|
||||||
result = None
|
result = None
|
||||||
try:
|
try:
|
||||||
|
@ -117,7 +117,7 @@ class preferences:
|
||||||
# Get the right sub-dict and change the key/value
|
# Get the right sub-dict and change the key/value
|
||||||
subdict = self.find_key(self.preferences, preference)
|
subdict = self.find_key(self.preferences, preference)
|
||||||
if not subdict:
|
if not subdict:
|
||||||
print "LUC(nosubdict):", preference, self.preferences
|
raise AttributeError("ERROR(nosubdict): looking for %s in: %s" %(preference, str(self.preferences)))
|
||||||
subdict[preference] = value
|
subdict[preference] = value
|
||||||
|
|
||||||
def set(self, preference, value=None):
|
def set(self, preference, value=None):
|
||||||
|
|
|
@ -28,12 +28,14 @@ class preventInvitationsTest(unittest.TestCase):
|
||||||
self.caldav = CalDAVSchedulingTest(self)
|
self.caldav = CalDAVSchedulingTest(self)
|
||||||
cal = self.prefs.get("Calendar")
|
cal = self.prefs.get("Calendar")
|
||||||
if "PreventInvitationsWhitelist" not in cal:
|
if "PreventInvitationsWhitelist" not in cal:
|
||||||
#print "LUC (cal):", cal
|
|
||||||
cal["PreventInvitationsWhitelist"] = None
|
cal["PreventInvitationsWhitelist"] = None
|
||||||
self.prefs.set("PreventInvitationsWhitelist", None)
|
self.prefs.set("PreventInvitationsWhitelist", None)
|
||||||
|
if "PreventInvitations" not in cal:
|
||||||
|
cal["PreventInvitations"] = 0
|
||||||
|
self.prefs.set("PreventInvitations", 0)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.prefs.set("autoReplyText", "")
|
#self.prefs.set("autoReplyText", "")
|
||||||
self.prefs.set('PreventInvitations', 0)
|
self.prefs.set('PreventInvitations', 0)
|
||||||
self.prefs.set("PreventInvitationsWhitelist", None)
|
self.prefs.set("PreventInvitationsWhitelist", None)
|
||||||
#- Manual Cleanup, not called because classs is not derived from unittest
|
#- Manual Cleanup, not called because classs is not derived from unittest
|
||||||
|
|
Loading…
Reference in New Issue