def test_parse_cadi_entry_when_entry_missing_some_fields(): cadi_resp = { u'code': 'EXO-00-000', u'paper': 'http://cms.cern.ch:80/paper.pdf', u'description': 'Projections for 2HDM Higgs studies (H->ZZ and A->Zh) in 3000 fb-1', u'name': '2HDM Higgs studies (H->ZZ and A->Zh)' } serializer = CADISchema() parsed = serializer.dump(cadi_resp).data assert parsed == { 'description': 'Projections for 2HDM Higgs studies (H->ZZ and A->Zh) in 3000 fb-1', 'name': '2HDM Higgs studies (H->ZZ and A->Zh)', 'contact': '', 'creator': '', 'updater': '', 'created': '', 'updated': '', 'twiki': '', 'paper': 'http://cms.cern.ch:80/paper.pdf', 'paper_tar': '', 'pas': '', 'hepData': '', 'publication_status': '', 'status': '', 'cadi_id': 'EXO-00-000', 'awg': '', 'conference': '' }
def test_parse_cadi_entry(): cadi_resp = { u'Conference': '', u'conferenceStatus': '', u'code': 'dANA-00-000', u'targetConference': None, u'approvalTalk': 'https://indico.cern.ch/event/event.pdf', u'updaterDate': '24/12/2014', u'creatorDate': '14/12/2014', u'PAS': '******', u'id': 1, u'updaterName': 'Updater User', u'targetPubPeriod': None, u'targetDatePreApp': '19/12/2014', u'PAPERTAR': 'http://cms.cern.ch:80/paper.tgz', u'contact': 'Contact User', u'status': 'PUB', u'URL': 'https://twiki.cern.ch/twikiurl', u'creatorName': 'Creator User', u'publicationStatus': 'Free', u'PAPER': 'http://cms.cern.ch:80/paper.pdf', u'description': 'Projections for 2HDM Higgs studies (H->ZZ and A->Zh) in 3000 fb-1', u'name': '2HDM Higgs studies (H->ZZ and A->Zh)' } serializer = CADISchema() parsed = serializer.dump(cadi_resp).data assert parsed == { 'description': 'Projections for 2HDM Higgs studies (H->ZZ and A->Zh) in 3000 fb-1', 'name': '2HDM Higgs studies (H->ZZ and A->Zh)', 'contact': 'Contact User', 'created': '14/12/2014', 'twiki': 'https://twiki.cern.ch/twikiurl', 'paper': 'http://cms.cern.ch:80/paper.pdf', 'pas': '******', 'publication_status': 'Free', 'status': 'PUB', 'cadi_id': 'ANA-00-000' }
def test_parse_cadi_entry(): cadi_resp = { 'conference': '', 'conferenceStatus': '', 'code': 'ANA-00-000', 'targetConference': None, 'approvalTalk': 'https://indico.cern.ch/event/event.pdf', 'creationDate': '2014-02-05', 'updateDate': '2014-07-26', 'pas': '******', 'id': 1, 'targetPubPeriod': None, 'targetDatePreApp': '19/12/2014', 'papertar': 'http://cms.cern.ch:80/paper.tgz', 'awg': 'HIG', 'contact': { 'cmsId': 1234, 'hrId': 5678, 'username': '******', 'email': '*****@*****.**' }, 'creator': { 'cmsId': 4321, 'hrId': 8765, 'username': '******', 'email': '*****@*****.**' }, 'updater': { 'cmsId': 4583, 'hrId': 411861, 'username': '******', 'email': '*****@*****.**' }, 'relatedNotesInfo': [{ 'noteId': 'CMS AN-2014/000', 'url': 'http://cms.cern.ch/noteInfo.jsp?cmsnoteid=CMS+AN-2014%2F000' }, { 'noteId': 'CMS AN-2013/000', 'url': 'http://cms.cern.ch/noteInfo.jsp?cmsnoteid=CMS+AN-2013%2F000' }], 'status': 'PUB', 'url': 'https://twiki.cern.ch/twikiurl', 'creatorName': 'Creator User', 'publicationStatus': 'Free', 'paper': 'http://cms.cern.ch:80/paper.pdf', 'description': 'Projections for 2HDM Higgs studies (H->ZZ and A->Zh) in 3000 fb-1', 'name': '2HDM Higgs studies (H->ZZ and A->Zh)', 'hepData': '', } serializer = CADISchema() parsed = serializer.dump(cadi_resp).data assert parsed == { 'description': 'Projections for 2HDM Higgs studies (H->ZZ and A->Zh) in 3000 fb-1', 'name': '2HDM Higgs studies (H->ZZ and A->Zh)', 'contact': '*****@*****.**', 'creator': '*****@*****.**', 'updater': '*****@*****.**', 'created': '2014-02-05', 'updated': '2014-07-26', 'twiki': 'https://twiki.cern.ch/twikiurl', 'paper': 'http://cms.cern.ch:80/paper.pdf', 'paper_tar': 'http://cms.cern.ch:80/paper.tgz', 'pas': '******', 'awg': 'HIG', 'publication_status': 'Free', 'status': 'PUB', 'cadi_id': 'ANA-00-000', 'conference': '', 'hepData': '', 'relatedNotes': [{ 'id': 'AN-2014/000', 'url': 'http://cms.cern.ch/noteInfo.jsp?cmsnoteid=CMS+AN-2014%2F000' }, { 'id': 'AN-2013/000', 'url': 'http://cms.cern.ch/noteInfo.jsp?cmsnoteid=CMS+AN-2013%2F000' }] }