1212m2 = PlumXMetrics ('10.2307/2281868' , 'doi' , refresh = 30 )
1313# A published paper. No PlumX Metrics.
1414m3 = PlumXMetrics ('2-s2.0-84950369844' , 'elsevierId' , refresh = 30 )
15- # An arXiv paper. No Citation metrics.
16- m4 = PlumXMetrics ('1507.02672' , 'arxivId' , refresh = 30 )
1715# A published book. No Social Media metrics.
18- m5 = PlumXMetrics ('9783540783893' , 'isbn' , refresh = 30 )
16+ m4 = PlumXMetrics ('9783540783893' , 'isbn' , refresh = 30 )
1917# A SSRN paper. No mention metrics.
20- m6 = PlumXMetrics ('3320470' , 'ssrnId' , refresh = 30 )
21- # A YouTube video. No Capture and Citation metrics.
22- m7 = PlumXMetrics ('dQw4w9WgXcQ' , 'youtubeVideoId' , refresh = 30 )
18+ m5 = PlumXMetrics ('3320470' , 'ssrnId' , refresh = 30 )
2319
2420
2521def test_category_totals ():
2622 m1_received = sorted ([c .name for c in m1 .category_totals ])
27- m1_expected = ['capture' , 'citation' , 'mention' , 'socialMedia' , 'usage' ]
23+ m1_expected = ['capture' , 'citation' , 'mention' , 'socialMedia' ]
2824 assert_equal (m1_received , m1_expected )
2925 m2_received = sorted ([c .name for c in m2 .category_totals ])
3026 m2_expected = ['capture' , 'citation' , 'mention' ]
3127 assert_equal (m2_received , m2_expected )
3228 assert_equal (m3 .category_totals , None )
33- m4_received = sorted ([c .name for c in m4 .category_totals ])
34- m4_expected = ['citation' , 'mention' , 'socialMedia' ]
35- assert_equal (m4_received , m4_expected )
36- m6_received = sorted ([c .name for c in m6 .category_totals ])
37- m6_expected = ['capture' , 'citation' , 'socialMedia' , 'usage' ]
38- assert_equal (m6_received , m6_expected )
39- m7_received = sorted ([c .name for c in m7 .category_totals ])
40- m7_expected = ['mention' , 'socialMedia' , 'usage' ]
41- assert_equal (m7_received , m7_expected )
42- for plumx in (m1 , m2 , m4 , m5 , m6 , m7 ):
29+ m5_received = sorted ([c .name for c in m5 .category_totals ])
30+ m5_expected = ['capture' , 'citation' , 'socialMedia' , 'usage' ]
31+ assert_equal (m5_received , m5_expected )
32+ for plumx in (m1 , m2 , m4 , m5 ):
4333 m_fields = set (field for ntup in plumx .category_totals for
4434 field in ntup ._fields )
4535 assert_equal (m_fields , {'name' , 'total' })
@@ -48,10 +38,9 @@ def test_category_totals():
4838
4939
5040def test_capture ():
51- for plumx in (m3 , m4 , m7 ):
52- assert_equal (plumx .capture , None )
41+ assert_equal (m3 .capture , None )
5342 expected = {'name' , 'total' }
54- for plumx in (m1 , m2 , m5 , m6 ):
43+ for plumx in (m1 , m2 , m4 , m5 ):
5544 assert_true (isinstance (plumx .capture , list ))
5645 assert_true (len (plumx .capture ) > 0 )
5746 m_fields = set (field for ntup in plumx .capture for field in ntup ._fields )
@@ -62,9 +51,8 @@ def test_capture():
6251
6352def test_citation ():
6453 assert_equal (m3 .citation , None )
65- assert_equal (m7 .citation , None )
6654 expected = {'name' , 'total' }
67- for plumx in (m1 , m2 , m4 , m5 , m6 ):
55+ for plumx in (m1 , m2 , m4 , m5 ):
6856 assert_true (isinstance (plumx .citation , list ))
6957 assert_true (len (plumx .citation ) > 0 )
7058 m_fields = set (field for ntup in plumx .citation for field in ntup ._fields )
@@ -75,9 +63,9 @@ def test_citation():
7563
7664def test_mention ():
7765 assert_equal (m3 .mention , None )
78- assert_equal (m6 .mention , None )
66+ assert_equal (m5 .mention , None )
7967 expected = {'name' , 'total' }
80- for plumx in (m1 , m2 , m4 , m5 , m7 ):
68+ for plumx in (m1 , m2 , m4 ):
8169 print (plumx )
8270 assert_true (isinstance (plumx .mention , list ))
8371 assert_true (len (plumx .mention ) > 0 )
@@ -90,9 +78,9 @@ def test_mention():
9078def test_social_media ():
9179 assert_equal (m2 .social_media , None )
9280 assert_equal (m3 .social_media , None )
93- assert_equal (m5 .social_media , None )
81+ assert_equal (m4 .social_media , None )
9482 expected = {'name' , 'total' }
95- for plumx in (m1 , m4 , m6 , m7 ):
83+ for plumx in (m1 , m5 ):
9684 assert_true (isinstance (plumx .social_media , list ))
9785 assert_true (len (plumx .social_media ) > 0 )
9886 m_fields = set (field for ntup in plumx .social_media for field in ntup ._fields )
@@ -104,9 +92,8 @@ def test_social_media():
10492def test_usage ():
10593 assert_equal (m2 .usage , None )
10694 assert_equal (m3 .usage , None )
107- assert_equal (m4 .usage , None )
10895 expected = {'name' , 'total' }
109- for plumx in (m1 , m5 , m6 , m7 ):
96+ for plumx in (m4 , m5 ):
11097 assert_true (isinstance (plumx .usage , list ))
11198 assert_true (len (plumx .usage ) > 0 )
11299 m_fields = set (field for ntup in plumx .usage for field in ntup ._fields )
0 commit comments