Skip to content

Commit

Permalink
Remove bare exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Timbo committed Nov 3, 2023
1 parent 17f59dd commit e620cc6
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions tests/test_filesmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ def test_tenant_is_used_in_xero_request(self, r_get):
xero = Xero(credentials)
# Just return any old response
r_get.return_value = None
try:
xero.filesAPI.files.all()
except: # NOQA: E722
pass
xero.filesAPI.files.all()

self.assertEqual(r_get.call_args[1]["headers"]["Xero-tenant-id"], "12345")

Expand All @@ -48,10 +45,7 @@ def test_upload_file_as_path(self, r_get):
)
xero = Xero(credentials)
r_get.return_value = None
try:
xero.filesAPI.files.upload_file(path=self.filepath)
except: # NOQA: E722
pass
xero.filesAPI.files.upload_file(path=self.filepath)

self.assertIn(self.filepath, r_get.call_args[1]["files"])

Expand All @@ -62,12 +56,10 @@ def test_upload_file_as_file(self, r_get):
)
xero = Xero(credentials)
r_get.return_value = None
try:
with open(self.filepath) as f:
xero.filesAPI.files.upload_file(
file=f, filename=os.path.basename(self.filepath)
)
except: # NOQA: E722
pass

with open(self.filepath) as f:
xero.filesAPI.files.upload_file(
file=f, filename=os.path.basename(self.filepath)
)

self.assertIn(self.filepath, r_get.call_args[1]["files"])

0 comments on commit e620cc6

Please sign in to comment.