-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from pitthsls/beda42-master
Beda42 master
- Loading branch information
Showing
7 changed files
with
120 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Platform Report 1 (R4) Total Searches, Result Clicks, and Record Views by Month and Platform | ||
A fake institution used for testing | ||
00000001 | ||
Period covered by Report: | ||
2018-01-01 to 2018-12-31 | ||
Date run: | ||
2019-08-01 | ||
Platform Publisher User Activity Reporting Period Total Jan-2018 Feb-2018 Mar-2018 Apr-2018 May-2018 Jun-2018 Jul-2018 Aug-2018 Sep-2018 Oct-2018 Nov-2018 Dec-2018 | ||
search.alexanderstreet.com Alexander Street Press Regular Searches 299 91 41 13 21 44 8 0 0 36 36 7 2 | ||
search.alexanderstreet.com Alexander Street Press Searches-federated and automated 0 0 0 0 0 0 0 0 0 0 0 0 0 | ||
search.alexanderstreet.com Alexander Street Press Result Clicks 87 19 18 1 8 13 5 0 0 13 6 2 2 | ||
search.alexanderstreet.com Alexander Street Press Record Views 100 22 19 1 9 19 5 0 0 15 6 2 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Test COUNTER DB1 database report""" | ||
|
||
from __future__ import absolute_import | ||
|
||
import os | ||
import unittest | ||
|
||
import pycounter.report | ||
|
||
|
||
class ParseCounter4Example(unittest.TestCase): | ||
"""Tests for parsing C4 PR1""" | ||
|
||
def setUp(self): | ||
self.report = pycounter.report.parse( | ||
os.path.join(os.path.dirname(__file__), "data/PR1.tsv") | ||
) | ||
|
||
def test_reportname(self): | ||
self.assertEqual(self.report.report_type, u"PR1") | ||
|
||
def test_stats(self): | ||
publication = self.report.pubs[0] | ||
self.assertEqual([x[2] for x in publication], | ||
[91, 41, 13, 21, 44, 8, 0, 0, 36, 36, 7, 2]) | ||
|
||
def test_row_metric(self): | ||
# test metric of the first row | ||
jan_data = next(iter(self.report.pubs[0])) | ||
self.assertEqual(jan_data[1], "Regular Searches") | ||
# test metric of the second row | ||
jan_data = next(iter(self.report.pubs[1])) | ||
self.assertEqual(jan_data[1], "Searches-federated and automated") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters