Skip to content

Commit

Permalink
add test to get item file of web plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
vicholp committed Aug 3, 2022
1 parent fde2ad3 commit 6803ef3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,16 @@ def test_patch_item_id_readonly(self):
# Remove the item
self.lib.get_item(item_id).remove()

def test_get_item_file(self):
ipath = os.path.join(self.temp_dir, b'testfile2.mp3')
shutil.copy(os.path.join(_common.RSRC, b'full.mp3'), ipath)
self.assertTrue(os.path.exists(ipath))
item_id = self.lib.add(Item.from_path(ipath))

response = self.client.get('/item/' + str(item_id) + '/file')

self.assertEqual(response.status_code, 200)


def suite():
return unittest.TestLoader().loadTestsFromName(__name__)
Expand Down

0 comments on commit 6803ef3

Please sign in to comment.