From f054b19f171883b7ea1dcbe40a3629e34771405a Mon Sep 17 00:00:00 2001 From: John Mertic Date: Mon, 2 Dec 2024 17:34:24 -0500 Subject: [PATCH] Pull Organization Description from LFX Org profile if it is set (#81) Signed-off-by: John Mertic --- lfx_landscape_tools/lfxmembers.py | 1 + test/test_lfxmembers.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lfx_landscape_tools/lfxmembers.py b/lfx_landscape_tools/lfxmembers.py index 7499f21..7d40956 100644 --- a/lfx_landscape_tools/lfxmembers.py +++ b/lfx_landscape_tools/lfxmembers.py @@ -41,6 +41,7 @@ def loadData(self): member.membership = record.get('Membership',{}).get('Name') member.website = record.get('Website') member.logo = record.get('Logo') + member.description = record.get('OrganizationDescription') if not member.logo: logger.info("Trying to create text logo") member.logo = SVGLogo(name=member.orgname) diff --git a/test/test_lfxmembers.py b/test/test_lfxmembers.py index 07353eb..2f8acc0 100755 --- a/test/test_lfxmembers.py +++ b/test/test_lfxmembers.py @@ -58,7 +58,7 @@ def testLoadData(self): responses.add( method=responses.GET, url=LFXMembers.endpointURL.format('tlf2'), - body="""[{"ID":"0014100000Te1TUAAZ","Name":"ConsenSys AG","CNCFLevel":"","LinkedInURL":"dog.com","CrunchBaseURL":"https://crunchbase.com/organization/consensus-systems--consensys-","Logo":"https://lf-master-organization-logos-prod.s3.us-east-2.amazonaws.com/consensys_ag.svg","Membership":{"Family":"Membership","ID":"01t41000002735aAAA","Name":"Premier Membership","Status":"Active"},"Slug":"hyp","StockTicker":"","Twitter":"","Website":"consensys.net"},{"ID":"0014100000Te04HAAR","Name":"Hitachi, Ltd.","CNCFLevel":"","LinkedInURL":"www.linkedin.com/company/hitachi-data-systems","Logo":"https://lf-master-organization-logos-prod.s3.us-east-2.amazonaws.com/hitachi-ltd.svg","Membership":{"Family":"Membership","ID":"01t41000002735aAAA","Name":"Premier Membership","Status":"Active"},"Slug":"hyp","StockTicker":"","Twitter":"https://yahoo.com","Website":"hitachi-systems.com"}]""" + body="""[{"ID":"0014100000Te1TUAAZ","Name":"ConsenSys AG","CNCFLevel":"","OrganizationDescription":"this org is cool","LinkedInURL":"dog.com","CrunchBaseURL":"https://crunchbase.com/organization/consensus-systems--consensys-","Logo":"https://lf-master-organization-logos-prod.s3.us-east-2.amazonaws.com/consensys_ag.svg","Membership":{"Family":"Membership","ID":"01t41000002735aAAA","Name":"Premier Membership","Status":"Active"},"Slug":"hyp","StockTicker":"","Twitter":"","Website":"consensys.net"},{"ID":"0014100000Te04HAAR","Name":"Hitachi, Ltd.","CNCFLevel":"","LinkedInURL":"www.linkedin.com/company/hitachi-data-systems","Logo":"https://lf-master-organization-logos-prod.s3.us-east-2.amazonaws.com/hitachi-ltd.svg","Membership":{"Family":"Membership","ID":"01t41000002735aAAA","Name":"Premier Membership","Status":"Active"},"Slug":"hyp","StockTicker":"","Twitter":"https://yahoo.com","Website":"hitachi-systems.com"}]""" ) responses.add( method=responses.GET, @@ -77,6 +77,7 @@ def testLoadData(self): self.assertEqual(members.members[0].crunchbase,"https://www.crunchbase.com/organization/consensus-systems--consensys-") self.assertEqual(members.members[0].logo,"consensys_ag.svg") self.assertEqual(members.members[0].membership,"Premier Membership") + self.assertEqual(members.members[0].description,"this org is cool") self.assertEqual(members.members[0].website,"https://consensys.net/") self.assertIsNone(members.members[0].linkedin) self.assertIsNone(members.members[0].twitter)