From 45c684100ffc611509b76549fbb2b93f2d21e41b Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Wed, 5 Aug 2015 16:57:17 -0300 Subject: [tests] Fixed remaining parse tests All the response parse tests are passing now, response with no entries was broken because it wasn't being treated and the others were broken because of calls that no longer existed --- client/src/leap/soledad/client/http_target.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'client/src/leap/soledad') diff --git a/client/src/leap/soledad/client/http_target.py b/client/src/leap/soledad/client/http_target.py index f5d8ef1c..31729e2c 100644 --- a/client/src/leap/soledad/client/http_target.py +++ b/client/src/leap/soledad/client/http_target.py @@ -527,8 +527,11 @@ class SoledadHTTPSyncTarget(SyncTarget): raise errors.BrokenSyncStream data = parts[1:-1] # decode metadata - line, comma = utils.check_and_strip_comma(data[0]) - metadata = None + try: + line, comma = utils.check_and_strip_comma(data[0]) + metadata = None + except (IndexError): + raise errors.BrokenSyncStream try: metadata = json.loads(line) new_generation = metadata['new_generation'] -- cgit v1.2.3