Skip to content

Commit

Permalink
improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed Sep 26, 2018
1 parent fd69dfe commit 9b44422
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions grapheneapi/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import traceback
import logging
from collections import Counter
from itertools import cycle
Expand Down Expand Up @@ -156,14 +155,15 @@ def func(*args, **kwargs):
# the above line should raise. Let's be sure to at least
# break
break # pragma: no cover
except IOError as e:
except IOError as e: # pragma: no cover
log.critical("Connection was closed remotely. Retrying")
self.error_url()
self.next()
except Exception as e:
except Exception as e: # pragma: no cover
""" When something fails talking to the backend
"""
# log.warning(traceback.format_exc())
import traceback
log.debug(traceback.format_exc())
log.warning(str(e))
log.warning("Reconnecting ...")
self.error_url()
Expand Down
6 changes: 2 additions & 4 deletions grapheneapi/websocket.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import websocket
import ssl
import json
import logging
from .exceptions import RPCError
import websocket
from .rpc import Rpc

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -39,9 +38,8 @@ def rpcexec(self, payload):
:param json payload: Payload data
:raises ValueError: if the server does not respond in proper JSON
format
:raises RPCError: if the server returns an error
"""
if not self.ws:
if not self.ws: # pragma: no cover
self.connect()

log.debug(json.dumps(payload))
Expand Down
4 changes: 2 additions & 2 deletions graphenebase/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ def __str__(self):

# Legacy support
@property
def data(self):
def data(self): # pragma: no cover
""" Read data explicitly (backwards compatibility)
"""
return self

@data.setter
def data(self, data):
def data(self, data): # pragma: no cover
""" Set data through a setter (backwards compatibility)
"""
self.update(data)
Expand Down

0 comments on commit 9b44422

Please sign in to comment.