From bf390f17dd6c6e8c6165bd4f675f422d3f0c0fc9 Mon Sep 17 00:00:00 2001 From: Luc Charland Date: Wed, 26 Aug 2015 15:07:11 -0400 Subject: [PATCH] fixed when strings not initialized in prefs --- Tests/Integration/preferences.py | 8 ++++---- Tests/Integration/test-prevent-invitations.py | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Tests/Integration/preferences.py b/Tests/Integration/preferences.py index 9620b271a..ea3e7b10b 100644 --- a/Tests/Integration/preferences.py +++ b/Tests/Integration/preferences.py @@ -89,9 +89,9 @@ class preferences: get = HTTPPreferencesGET(url) get.cookie = self.cookie self.client.execute(get) - if DEBUG: print "LUC (url):", url - if DEBUG: print "LUC (status):", get.response["status"] - if DEBUG: print "LUC (body):", get.response['body'] + if DEBUG: print "DEBUG (url):", url + if DEBUG: print "DEBUG (status):", get.response["status"] + if DEBUG: print "DEBUG (body):", get.response['body'] content = simplejson.loads(get.response['body']) result = None try: @@ -117,7 +117,7 @@ class preferences: # Get the right sub-dict and change the key/value subdict = self.find_key(self.preferences, preference) 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 def set(self, preference, value=None): diff --git a/Tests/Integration/test-prevent-invitations.py b/Tests/Integration/test-prevent-invitations.py index 0ed60f589..c359d5369 100755 --- a/Tests/Integration/test-prevent-invitations.py +++ b/Tests/Integration/test-prevent-invitations.py @@ -28,12 +28,14 @@ class preventInvitationsTest(unittest.TestCase): self.caldav = CalDAVSchedulingTest(self) cal = self.prefs.get("Calendar") if "PreventInvitationsWhitelist" not in cal: - #print "LUC (cal):", cal cal["PreventInvitationsWhitelist"] = None self.prefs.set("PreventInvitationsWhitelist", None) + if "PreventInvitations" not in cal: + cal["PreventInvitations"] = 0 + self.prefs.set("PreventInvitations", 0) def tearDown(self): - self.prefs.set("autoReplyText", "") + #self.prefs.set("autoReplyText", "") self.prefs.set('PreventInvitations', 0) self.prefs.set("PreventInvitationsWhitelist", None) #- Manual Cleanup, not called because classs is not derived from unittest