Skip to content

Commit

Permalink
Return 404 when asset is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
c8y3 committed Jan 31, 2025
1 parent f25da43 commit 43a3162
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/tests_rest_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ def test_update_asset_should_return_correct_asset_uuid(self):
{'asset_type_id': 1, 'asset_name': 'new_asset_name'}).json()
self.assertEqual(asset_uuid, response['asset_uuid'])

def test_update_asset_should_return_404_when_asset_not_found(self):
case_identifier = self._subject.create_dummy_case()
response = self._subject.update(f'/api/v2/cases/{case_identifier}/assets/{_IDENTIFIER_FOR_NONEXISTENT_OBJECT}',
{'asset_type_id': 1, 'asset_name': 'new_asset_name'})
self.assertEqual(404, response.status_code)

def test_delete_asset_should_return_204(self):
case_identifier = self._subject.create_dummy_case()
body = {'asset_type_id': 1, 'asset_name': 'admin_laptop_test'}
Expand Down

0 comments on commit 43a3162

Please sign in to comment.