Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test to update asset analysis_status_id
Browse files Browse the repository at this point in the history
c8y3 committed Jan 31, 2025
1 parent 7ed34e3 commit 37d91cc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/tests_rest_assets.py
Original file line number Diff line number Diff line change
@@ -102,6 +102,16 @@ def test_update_asset_should_return_404_when_asset_not_found(self):
{'asset_type_id': 1, 'asset_name': 'new_asset_name'})
self.assertEqual(404, response.status_code)

def test_update_asset_should_allow_to_update_analysis_status(self):
case_identifier = self._subject.create_dummy_case()
body = {'asset_type_id': 1, 'asset_name': 'admin_laptop_test'}
response = self._subject.create(f'/api/v2/cases/{case_identifier}/assets', body).json()
identifier = response['asset_id']
response = self._subject.update(f'/api/v2/cases/{case_identifier}/assets/{identifier}',
{'asset_type_id': 1, 'asset_name': 'admin_laptop_test', 'analysis_status_id': 2}).json()
self.assertEqual(2, response['analysis_status_id'])


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'}

0 comments on commit 37d91cc

Please sign in to comment.