fix: Update live tests to support proper format of SGs

pull/818/head
Raphaël Vinot 2021-11-30 11:41:53 +01:00
parent afedd8d90b
commit bc37a03174
2 changed files with 4 additions and 4 deletions

View File

@ -186,8 +186,8 @@ class MISPSharingGroup(AbstractMISP):
def __repr__(self) -> str:
if hasattr(self, 'name'):
return f'<{self.__class__.__name__}(name={self.name})'
return f'<{self.__class__.__name__}(NotInitialized)'
return f'<{self.__class__.__name__}(name={self.name})>'
return f'<{self.__class__.__name__}(NotInitialized)>'
def _to_feed(self) -> Dict:
to_return = super()._to_feed()

View File

@ -2227,8 +2227,8 @@ class TestComprehensive(unittest.TestCase):
self.assertEqual(sharing_group.name, 'Testcases SG')
# Check we have the org field present and the first org is our org
self.assertTrue(isinstance(getattr(sharing_group, "orgs"), list))
self.assertEqual(sharing_group.orgs[0].id, self.test_org.id)
self.assertTrue(isinstance(getattr(sharing_group, "sgorgs"), list))
self.assertEqual(sharing_group.sgorgs[0].org_id, self.test_org.id)
finally:
self.admin_misp_connector.delete_sharing_group(sharing_group.id)