def get_pub_date_str_from_lax(self, doi_id): """ Check lax for any article published version If found, get the pub date and format it as a string YYYYMMDDhhmmss """ article_id = str(doi_id).zfill(5) return lax_provider.article_publication_date(article_id, self.settings, self.logger)
def test_article_publication_date_500(self, mock_lax_provider_article_versions): mock_lax_provider_article_versions.return_value = 500, None date_str = lax_provider.article_publication_date('08411', settings_mock) self.assertEqual(None, date_str)
def test_article_publication_date_200(self, mock_lax_provider_article_versions): mock_lax_provider_article_versions.return_value = 200, test_data.lax_article_versions_response_data date_str = lax_provider.article_publication_date('08411', settings_mock) self.assertEqual('20151126000000', date_str)
def test_article_publication_date_500(self, mock_lax_provider_article_versions): mock_lax_provider_article_versions.return_value = 500, None date_str = lax_provider.article_publication_date( '08411', settings_mock) self.assertEqual(None, date_str)
def test_article_publication_date_200(self, mock_lax_provider_article_versions): mock_lax_provider_article_versions.return_value = 200, test_data.lax_article_versions_response_data date_str = lax_provider.article_publication_date( '08411', settings_mock) self.assertEqual('20151126000000', date_str)