Skip to content

Commit

Permalink
Revert 2819d02 completely & a954641's test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinleinweber committed Mar 5, 2018
1 parent 2819d02 commit 9062db9
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 15 deletions.
3 changes: 1 addition & 2 deletions hepcrawl/spiders/edp_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import tarfile
from tempfile import mkdtemp

from re import sub
from scrapy import Request
from scrapy.spiders import XMLFeedSpider

Expand Down Expand Up @@ -508,7 +507,7 @@ def _get_external_links(self, ref):
urls = []
for ext_link in ext_links:
if "doi" in ext_link:
doi = "doi:" + ext_link.sub("https?://(dx\.)?doi.org/", "")
doi = "doi:" + ext_link.replace("http://dx.doi.org/", "")
else:
urls.append(ext_link)

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/responses/aps/PhysRevD.96.095036.xml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tests/unit/responses/aps/PhysRevX.7.021022.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<award-group award-type="unspecified">
<funding-source>
<named-content content-type="name">National Science Foundation</named-content>
<named-content content-type="fundref:id">https://doi.org/10.13039/100000001</named-content>
<named-content content-type="fundref:id">http://dx.doi.org/10.13039/100000001</named-content>
<named-content content-type="fundref:alternate-name">NSF</named-content>
<named-content content-type="country">http://sws.geonames.org/6252001/</named-content>
<named-content content-type="aps-code">NSF</named-content>
Expand All @@ -106,22 +106,22 @@
<award-group award-type="unspecified">
<funding-source>
<named-content content-type="name">Gordon and Betty Moore Foundation</named-content>
<named-content content-type="fundref:id">https://doi.org/10.13039/100000936</named-content>
<named-content content-type="fundref:id">http://dx.doi.org/10.13039/100000936</named-content>
<named-content content-type="fundref:alternate-name">Gordon E. and Betty I. Moore Foundation</named-content>
<named-content content-type="country">http://sws.geonames.org/6252001/</named-content>
</funding-source>
</award-group>
<award-group award-type="unspecified">
<funding-source>
<named-content content-type="name">Simons Foundation</named-content>
<named-content content-type="fundref:id">https://doi.org/10.13039/100000893</named-content>
<named-content content-type="fundref:id">http://dx.doi.org/10.13039/100000893</named-content>
<named-content content-type="country">http://sws.geonames.org/6252001/</named-content>
</funding-source>
</award-group>
<award-group award-type="unspecified">
<funding-source>
<named-content content-type="name">H2020 European Research Council</named-content>
<named-content content-type="fundref:id">https://doi.org/10.13039/100010663</named-content>
<named-content content-type="fundref:id">http://dx.doi.org/10.13039/100010663</named-content>
<named-content content-type="fundref:alternate-name">H2020 Excellent Science - European Research Council</named-content>
<named-content content-type="fundref:alternate-name">European Research Council</named-content>
<named-content content-type="fundref:alternate-name">ERC</named-content>
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/responses/aps/aps_single_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
},
"fundings":[
{
"funderId":"https://doi.org/10.13039/100000001",
"funderId":"http://dx.doi.org/10.13039/100000001",
"awards":[
"IIS\u20131247696"
],
"funderName":"National Science Foundation"
},
{
"funderId":"https://doi.org/10.13039/100007231",
"funderId":"http://dx.doi.org/10.13039/100007231",
"awards":[

],
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/responses/elsevier/sample_consyn_record.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
xmlns:sb="http://www.elsevier.com/xml/common/struct-bib/schema"
xmlns:xlink="http://www.w3.org/1999/xlink">
<rdf:RDF>
<rdf:Description rdf:about="https://doi.org/10.1016/0370-2693(88)91603-6">
<rdf:Description rdf:about="http://dx.doi.org/10.1016/0370-2693(88)91603-6">
<dct:format>application/xml</dct:format>
<dct:title>Toward classification of conformal theories</dct:title>
<dct:creator>Cumrun Vafa</dct:creator>
Expand All @@ -34,7 +34,7 @@
<prism:startingPage>421</prism:startingPage>
<prism:endingPage>426</prism:endingPage>
<prism:doi>10.1016/0370-2693(88)91603-6</prism:doi>
<prism:url>https://doi.org/10.1016/0370-2693(88)91603-6</prism:url>
<prism:url>http://dx.doi.org/10.1016/0370-2693(88)91603-6</prism:url>
<dct:identifier>doi:10.1016/0370-2693(88)91603-6</dct:identifier>
</rdf:Description>
</rdf:RDF>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/responses/hindawi/test_1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ detection and observation of the prompt optical emission of the &#x201C;naked-ey
<subfield code="n">fulltext</subfield>
</datafield>
<datafield tag="856" ind1="4" ind2="0">
<subfield code="u">https://doi.org/10.1155/2010/194946</subfield>
<subfield code="u">http://dx.doi.org/10.1155/2010/194946</subfield>
<subfield code="z">Full text URL</subfield>
</datafield>
</marc:record>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_edp.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ def record_references_only():
<title>References</title>
<ref id="R5"><label>5.</label><mixed-citation publication-type="journal" id="a"><string-name><given-names>R.V.</given-names> <surname>Krishnan</surname></string-name>, <string-name><given-names>G.</given-names> <surname>Panneerselvam</surname></string-name>, <string-name><given-names>P.</given-names> <surname>Manikandan</surname></string-name> <string-name><given-names>M.P.</given-names> <surname>Antony</surname></string-name>, <string-name><given-names>K.</given-names> <surname>Nagarajan</surname></string-name>, <source>J. Nucl. Radiochem. Sci.</source>, <volume>10</volume>.<issue>1</issue>, <fpage>19</fpage>–<lpage>26</lpage> (<year>2009</year>).</mixed-citation></ref>
<ref id="R44"><label>44.</label><mixed-citation publication-type="journal"><string-name><given-names>L.</given-names> <surname>Cronin</surname></string-name>, <string-name><given-names>P.</given-names> <surname>Sojka</surname></string-name>, <string-name><given-names>A.</given-names> <surname>Lefebvre</surname></string-name>, <source>SAE Technical Paper</source>, DOI: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.4271/852086">10.4271/852086</ext-link>, (<year>1985</year>)</mixed-citation></ref>
<ref id="R44"><label>44.</label><mixed-citation publication-type="journal"><string-name><given-names>L.</given-names> <surname>Cronin</surname></string-name>, <string-name><given-names>P.</given-names> <surname>Sojka</surname></string-name>, <string-name><given-names>A.</given-names> <surname>Lefebvre</surname></string-name>, <source>SAE Technical Paper</source>, DOI: <ext-link ext-link-type="uri" xlink:href="http://dx.doi.org/10.4271/852086">10.4271/852086</ext-link>, (<year>1985</year>)</mixed-citation></ref>
<ref id="R3"><label>3.</label><mixed-citation publication-type="book"><string-name><given-names>T.</given-names> <surname>Aliyev</surname></string-name>, <string-name><given-names>Т.</given-names> <surname>Belyaev</surname></string-name>, <string-name><given-names>S.</given-names> <surname>Gallagher</surname></string-name> <article-title>Simulation in ANSYS flow to the gas purification section of the multicomponent gas mixture through the dust cyclone CKBN GP-628</article-title>. <source>Mechanical engineering</source>, <publisher-loc>Moscow</publisher-loc>, №<issue>10</issue>, (<year>2014</year>).</mixed-citation></ref>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_elsevier.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def parsed_node():
</oa:sponsor>
<oa:userLicense xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">http://creativecommons.org/licenses/by/3.0/</oa:userLicense>
</oa:openAccessInformation>
<rdf:Description rdf:about="https://doi.org/10.1016/0370-2693(88)91603-6">
<rdf:Description rdf:about="http://dx.doi.org/10.1016/0370-2693(88)91603-6">
<dct:title>Toward classification of conformal theories</dct:title>
<prism:doi>10.1016/0370-2693(88)91603-6</prism:doi>
<prism:startingPage>421</prism:startingPage>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_hindawi.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_files(record):

def test_urls(record):
"""Test url in record."""
urls = ["https://doi.org/10.1155/2010/194946"]
urls = ["http://dx.doi.org/10.1155/2010/194946"]
assert "urls" in record
assert len(record["urls"]) == 1

Expand Down

0 comments on commit 9062db9

Please sign in to comment.