Skip to content

Commit

Permalink
Fix test call
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Jun 14, 2024
1 parent b66215d commit 9a7106d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions inventree/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,6 @@ def upload(cls, api, attachment, comment='', **kwargs):
data = kwargs
data['comment'] = comment

print("Attachment.upload:", cls, api, attachment, comment, kwargs)

if type(attachment) is str:
if not os.path.exists(attachment):
raise FileNotFoundError(f"Attachment file '{attachment}' does not exist")
Expand All @@ -461,8 +459,6 @@ def upload(cls, api, attachment, comment='', **kwargs):
# Assumes a StringIO or BytesIO like object
name = getattr(attachment, 'name', 'filename')

print("Uploading:", Attachment.URL, data)

response = api.post(
Attachment.URL,
data,
Expand Down
2 changes: 1 addition & 1 deletion test/test_part.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def test_part_attachment(self):

# Test that attempting to upload an invalid file fails
with self.assertRaises(FileNotFoundError):
prt.uploadAttachment(self.api, 'test-file.txt')
prt.uploadAttachment('test-file.txt')

# Check that no new files have been uploaded
self.assertEqual(len(prt.getAttachments()), n)
Expand Down

0 comments on commit 9a7106d

Please sign in to comment.