Skip to content

Commit f0ac12b

Browse files
committed
Add tests
1 parent 4f8537e commit f0ac12b

File tree

5 files changed

+134
-0
lines changed

5 files changed

+134
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

test/arxiv.xml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<feed xmlns="http://www.w3.org/2005/Atom">
3+
<link href="http://arxiv.org/api/query?search_query%3D1301.7746%26id_list%3D%26start%3D0%26max_results%3D1" rel="self" type="application/atom+xml"/>
4+
<title type="html">ArXiv Query: search_query=1301.7746&amp;id_list=&amp;start=0&amp;max_results=1</title>
5+
<id>http://arxiv.org/api/NIaVv86zj4leHWkr6xTS1LwRjlw</id>
6+
<updated>2013-02-02T00:00:00-05:00</updated>
7+
<opensearch:totalResults xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">1</opensearch:totalResults>
8+
<opensearch:startIndex xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">0</opensearch:startIndex>
9+
<opensearch:itemsPerPage xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">1</opensearch:itemsPerPage>
10+
<entry>
11+
<id>http://arxiv.org/abs/1301.7746v1</id>
12+
<updated>2013-01-31T20:46:12Z</updated>
13+
<published>2013-01-31T20:46:12Z</published>
14+
<title>Phases and phase transitions in disordered quantum systems</title>
15+
<summary> These lecture notes give a pedagogical introduction to phase transitions in
16+
disordered quantum systems and to the exotic Griffiths phases induced in their
17+
vicinity. We first review some fundamental concepts in the physics of phase
18+
transitions. We then derive criteria governing under what conditions spatial
19+
disorder or randomness can change the properties of a phase transition. After
20+
introducing the strong-disorder renormalization group method, we discuss in
21+
detail some of the exotic phenomena arising at phase transitions in disordered
22+
quantum systems. These include infinite-randomness criticality, rare regions
23+
and quantum Griffiths singularities, as well as the smearing of phase
24+
transitions. We also present a number of experimental examples.
25+
</summary>
26+
<author>
27+
<name>Thomas Vojta</name>
28+
</author>
29+
<arxiv:comment xmlns:arxiv="http://arxiv.org/schemas/atom">Pedagogical introduction to strong disorder physics at quantum phase
30+
transitions. Based on lectures given at the XVII Training Course in the
31+
Physics of Strongly Correlated Systems in Vietri sul Mare, Italy in October
32+
2012. Submitted to the proceedings of this school. 60 pages and 23 figures.
33+
Builds on material reviewed in arXiv:cond-mat/0602312 and arXiv:1005.2707</arxiv:comment>
34+
<link href="http://arxiv.org/abs/1301.7746v1" rel="alternate" type="text/html"/>
35+
<link title="pdf" href="http://arxiv.org/pdf/1301.7746v1" rel="related" type="application/pdf"/>
36+
<arxiv:primary_category xmlns:arxiv="http://arxiv.org/schemas/atom" term="cond-mat.dis-nn" scheme="http://arxiv.org/schemas/atom"/>
37+
<category term="cond-mat.dis-nn" scheme="http://arxiv.org/schemas/atom"/>
38+
<category term="cond-mat.str-el" scheme="http://arxiv.org/schemas/atom"/>
39+
</entry>
40+
</feed>

test/doi.xml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<doi_records>
3+
<doi_record owner="10.1021" timestamp="2011-05-21 00:52:16">
4+
<crossref>
5+
<journal>
6+
<journal_metadata language="en">
7+
<full_title>Analytical Chemistry</full_title>
8+
<abbrev_title>Anal. Chem.</abbrev_title>
9+
<issn media_type="print">0003-2700</issn>
10+
<issn media_type="electronic">1520-6882</issn>
11+
</journal_metadata>
12+
<journal_issue>
13+
<publication_date media_type="print">
14+
<month>10</month>
15+
<year>2010</year>
16+
</publication_date>
17+
<journal_volume>
18+
<volume>82</volume>
19+
</journal_volume>
20+
<issue>19</issue>
21+
</journal_issue>
22+
<journal_article publication_type="full_text">
23+
<titles>
24+
<title>Basic Modeling Approach To Optimize Elemental Imaging by Laser Ablation ICPMS</title>
25+
</titles>
26+
<contributors>
27+
<person_name sequence="first" contributor_role="author">
28+
<given_name>Jure</given_name>
29+
<surname>Triglav</surname>
30+
</person_name>
31+
<person_name sequence="additional" contributor_role="author">
32+
<given_name>Johannes T.</given_name>
33+
<surname>van Elteren</surname>
34+
</person_name>
35+
<person_name sequence="additional" contributor_role="author">
36+
<given_name>Vid S.</given_name>
37+
<surname>Šelih</surname>
38+
</person_name>
39+
</contributors>
40+
<publication_date media_type="print">
41+
<month>10</month>
42+
<year>2010</year>
43+
</publication_date>
44+
<pages>
45+
<first_page>8153</first_page>
46+
<last_page>8160</last_page>
47+
</pages>
48+
<publisher_item>
49+
<identifier id_type="doi">10.1021/ac1014832</identifier>
50+
</publisher_item>
51+
<doi_data>
52+
<doi>10.1021/ac1014832</doi>
53+
<resource>http://pubs.acs.org/doi/abs/10.1021/ac1014832</resource>
54+
</doi_data>
55+
</journal_article>
56+
</journal>
57+
</crossref>
58+
</doi_record>
59+
</doi_records>

test/test_helper.rb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'webmock/test_unit'

test/test_paper_metadata.rb

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
require 'test/unit'
2+
require 'paper_metadata'
3+
require 'test_helper'
4+
5+
class PaperMetadataTest < Test::Unit::TestCase
6+
def test_doi_parsing
7+
8+
doi_response = File.read(File.join(File.dirname(__FILE__), 'doi.xml'))
9+
stub_request(:any, /www.crossref.org\/.*/).
10+
to_return(:body => doi_response, :status => 200, :headers => { 'Content-Length' => doi_response.length } )
11+
12+
PaperMetadata.doi_username = '[email protected]'
13+
assert_equal "Basic Modeling Approach To Optimize Elemental Imaging by Laser Ablation ICPMS",
14+
PaperMetadata.metadata_for('doi:10.1021/ac1014832')[:title]
15+
end
16+
17+
def test_fail_doi_if_no_username
18+
doi_response = File.read(File.join(File.dirname(__FILE__), 'doi.xml'))
19+
stub_request(:any, /www.crossref.org\/.*/).
20+
to_return(:body => doi_response, :status => 200, :headers => { 'Content-Length' => doi_response.length } )
21+
PaperMetadata.doi_username = nil
22+
assert_raise RuntimeError do
23+
PaperMetadata.metadata_for('doi:10.1021/ac1014832')
24+
end
25+
end
26+
27+
def test_arxiv_parsing
28+
arxiv_response = File.read(File.join(File.dirname(__FILE__), 'arxiv.xml'))
29+
stub_request(:any, /.*arxiv.org\/.*/).
30+
to_return(:body => arxiv_response, :status => 200, :headers => { 'Content-Length' => arxiv_response.length } )
31+
assert_equal "Thomas Vojta",
32+
PaperMetadata.metadata_for('arXiv:1301.7746')[:author]
33+
end
34+
end

0 commit comments

Comments
 (0)