From 10bd88cb061646bae609c8e7739b97179eab8fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 5 Jul 2019 10:34:48 +0200 Subject: [PATCH] chg: [tests] Add custom error message on upload_sample - fix last commit. --- tests/testlive_comprehensive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testlive_comprehensive.py b/tests/testlive_comprehensive.py index 13536d7..d5a6c38 100644 --- a/tests/testlive_comprehensive.py +++ b/tests/testlive_comprehensive.py @@ -879,8 +879,8 @@ class TestComprehensive(unittest.TestCase): with open('tests/testlive_comprehensive.py', 'rb') as f: response = self.user_misp_connector.upload_sample(filename='testfile.py', filepath_or_bytes=f.read(), event_id=first.id) - - self.assertEqual(response['message'], 'Success, saved all attributes.', "Content of response: {}".format(response)) + self.assertTrue('message' in response, "Content of response: {}".format(response)) + self.assertEqual(response['message'], 'Success, saved all attributes.') first = self.user_misp_connector.get_event(first.id) self.assertEqual(len(first.objects), 1) self.assertEqual(first.objects[0].name, 'file')