Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Excluded more lines from unit tests

  • Loading branch information...
commit 8ff7608d7e457b1f765bf909a0fc7049c373fc72 1 parent 1eee320
Simon Cadman authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 printer.py
14 printer.py
View
@@ -172,11 +172,11 @@ def readFile(self, pathname):
f = open(pathname, 'rb')
try:
s = f.read()
- except IOError, e:
+ except IOError, e: # pragma: no cover
print('ERROR: Error reading %s\n%s', pathname, e)
f.close()
return s
- except IOError, e:
+ except IOError, e: # pragma: no cover
print('ERROR: Error opening %s\n%s', pathname, e)
return None
@@ -195,10 +195,10 @@ def writeFile(self, file_name, data):
f = open(file_name, 'wb')
try:
f.write(data)
- except IOError, e:
+ except IOError, e: # pragma: no cover
status = False
f.close()
- except IOError, e:
+ except IOError, e: # pragma: no cover
status = False
return status
@@ -224,7 +224,7 @@ def base64Encode(self, pathname):
if self.writeFile(b64_pathname, b64data):
return b64_pathname
else:
- return None
+ return None # pragma: no cover
def encodeMultiPart(self, fields, file_type='application/xml'):
"""Encodes list of parameters for HTTP multipart format.
@@ -304,7 +304,7 @@ def submitJob(self, printerid, jobtype, jobfile, jobname, printername ):
print("ERROR: PDF doesnt exist")
return False
b64file = self.base64Encode(jobfile)
- if b64file == None:
+ if b64file == None: # pragma: no cover
print("ERROR: Cannot write to file: " + b64file)
return False
fdata = self.readFile(b64file)
@@ -347,6 +347,6 @@ def submitJob(self, printerid, jobtype, jobfile, jobname, printername ):
print('ERROR: Print job %s failed with %s', jobtype, responseobj['message'])
return False
- except Exception, error_msg: # pragma: no cover
+ except Exception, error_msg: # pragma: no cover
print('ERROR: Print job %s failed with %s', jobtype, error_msg)
return False
Please sign in to comment.
Something went wrong with that request. Please try again.