|
| 1 | +# IRIS Source Code |
| 2 | +# Copyright (C) 2023 - DFIR-IRIS |
| 3 | + |
| 4 | +# |
| 5 | +# This program is free software; you can redistribute it and/or |
| 6 | +# modify it under the terms of the GNU Lesser General Public |
| 7 | +# License as published by the Free Software Foundation; either |
| 8 | +# version 3 of the License, or (at your option) any later version. |
| 9 | +# |
| 10 | +# This program is distributed in the hope that it will be useful, |
| 11 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | +# Lesser General Public License for more details. |
| 14 | +# |
| 15 | +# You should have received a copy of the GNU Lesser General Public License |
| 16 | +# along with this program; if not, write to the Free Software Foundation, |
| 17 | +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | + |
| 19 | +from unittest import TestCase |
| 20 | +from iris import Iris |
| 21 | + |
| 22 | +_FIRST_ASSET_TYPE_IDENTIFIER = 1 |
| 23 | + |
| 24 | + |
| 25 | +class TestsRestAssetTypes(TestCase): |
| 26 | + |
| 27 | + def setUp(self) -> None: |
| 28 | + self._subject = Iris() |
| 29 | + |
| 30 | + def tearDown(self): |
| 31 | + self._subject.clear_database() |
| 32 | + |
| 33 | + def test_update_asset_type_should_return_200(self): |
| 34 | + url = f'/manage/asset-type/update/{_FIRST_ASSET_TYPE_IDENTIFIER}' |
| 35 | + data = {'asset_name': 'Account', 'asset_description': 'Generic Account'} |
| 36 | + with open('data/img/desktop.png', 'rb') as file_not_compromised: |
| 37 | + files = {'asset_icon_not_compromised': file_not_compromised, 'asset_icon_compromised': ('', '')} |
| 38 | + response = self._subject.post_multipart_encoded_files(url, data, files) |
| 39 | + self.assertEqual(200, response.status_code) |
0 commit comments