From d09824b8d2bd5397db124d461dba1aaca3680473 Mon Sep 17 00:00:00 2001 From: Heather Piwowar Date: Mon, 10 Dec 2012 08:56:35 -0800 Subject: [PATCH] fix documentation to remove providerRunCounter etc --- apiary.apib | 2 -- extras/couch_maint.py | 6 ------ scratchpad.js | 14 -------------- test/unit_tests/test_models.py | 8 ++++---- test/unit_tests/test_views.py | 16 ---------------- 5 files changed, 4 insertions(+), 42 deletions(-) diff --git a/apiary.apib b/apiary.apib index 4d7a91aa..8e190672 100644 --- a/apiary.apib +++ b/apiary.apib @@ -526,7 +526,6 @@ GET /v1/item/github/egonw,cdk?key=YOURKEY } } }, - "providersWithMetricsCount": 10, "type": "item" } @@ -610,7 +609,6 @@ GET /v1/item/url/http://www.slideshare.net/cavlec/who-owns-our-work?key=YOURKEY } } }, - "providersWithMetricsCount": 11, "type": "item" } diff --git a/extras/couch_maint.py b/extras/couch_maint.py index 39c34dbd..11aa5000 100644 --- a/extras/couch_maint.py +++ b/extras/couch_maint.py @@ -14,12 +14,6 @@ logger = logging.getLogger("couch_maint") -# hardcode it -#cloudant_url = "http://app5109761.heroku:TuLL8oXFh4k0iAcAPnDMlSjC@app5109761.heroku.cloudant.com" #production -#cloudant_url = "http://app5492954.heroku:Tkvx8JlwIoNkCJcnTscpKcRl@app5492954.heroku.cloudant.com" #staging -#cloudant_db = "heather_ti" -#cloudant_db = "ti" - cloudant_db = os.getenv("CLOUDANT_DB") cloudant_url = os.getenv("CLOUDANT_URL") diff --git a/scratchpad.js b/scratchpad.js index 7730a84c..3fb013fd 100644 --- a/scratchpad.js +++ b/scratchpad.js @@ -59,19 +59,5 @@ } }, }, - "providersRunCounter": 10, - "providersWithMetricsCount": 10, - "providers_run": [ - "Slideshare", - "Github", - "Plosalm", - "Facebook", - "Topsy", - "Citeulike", - "Wikipedia", - "Delicious", - "Mendeley", - "Dryad" -], "type": "item" } \ No newline at end of file diff --git a/test/unit_tests/test_models.py b/test/unit_tests/test_models.py index c055b42c..c29e0b14 100644 --- a/test/unit_tests/test_models.py +++ b/test/unit_tests/test_models.py @@ -198,9 +198,9 @@ def test_alias_dict_from_tuples(self): assert_equals(alias_dict, {'unknown_namespace': ['myname']}) def test_build_item_for_client(self): - item = {'created': '2012-08-23T14:40:16.399932', '_rev': '6-3e0ede6e797af40860e9dadfb39056ce', 'providersWithMetricsCount': 11, 'last_modified': '2012-08-23T14:40:16.399932', 'biblio': {'title': 'Perceptual training strongly improves visual motion perception in schizophrenia', 'journal': 'Brain and Cognition', 'year': 2011, 'authors': u'Norton, McBain, \xd6ng\xfcr, Chen'}, '_id': '4mlln04q1rxy6l9oeb3t7ftv', 'type': 'item', 'aliases': {'url': ['http://linkinghub.elsevier.com/retrieve/pii/S0278262611001308', 'http://www.ncbi.nlm.nih.gov/pubmed/21872380'], 'pmid': ['21872380'], 'doi': ['10.1016/j.bandc.2011.08.003'], 'title': ['Perceptual training strongly improves visual motion perception in schizophrenia']}} + item = {'created': '2012-08-23T14:40:16.399932', '_rev': '6-3e0ede6e797af40860e9dadfb39056ce', 'last_modified': '2012-08-23T14:40:16.399932', 'biblio': {'title': 'Perceptual training strongly improves visual motion perception in schizophrenia', 'journal': 'Brain and Cognition', 'year': 2011, 'authors': u'Norton, McBain, \xd6ng\xfcr, Chen'}, '_id': '4mlln04q1rxy6l9oeb3t7ftv', 'type': 'item', 'aliases': {'url': ['http://linkinghub.elsevier.com/retrieve/pii/S0278262611001308', 'http://www.ncbi.nlm.nih.gov/pubmed/21872380'], 'pmid': ['21872380'], 'doi': ['10.1016/j.bandc.2011.08.003'], 'title': ['Perceptual training strongly improves visual motion perception in schizophrenia']}} response = models.ItemFactory.build_item_for_client(item, self.myrefsets) - assert_equals(set(response.keys()), set(['created', '_rev', 'providersWithMetricsCount', 'metrics', 'last_modified', 'biblio', '_id', 'type', 'aliases'])) + assert_equals(set(response.keys()), set(['created', '_rev', 'metrics', 'last_modified', 'biblio', '_id', 'type', 'aliases'])) def test_build_item_for_client_excludes_history_by_default(self): response = models.ItemFactory.build_item_for_client(self.ITEM_DATA, self.myrefsets) @@ -221,7 +221,7 @@ def test_build_item_for_client_includes_history_with_arg(self): def add_metrics_data(self): - item = {'created': '2012-08-23T14:40:16.399932', '_rev': '6-3e0ede6e797af40860e9dadfb39056ce', 'providersWithMetricsCount': 11, 'last_modified': '2012-08-23T14:40:16.399932', 'biblio': {'title': 'Perceptual training strongly improves visual motion perception in schizophrenia', 'journal': 'Brain and Cognition', 'year': 2011, 'authors': u'Norton, McBain, \xd6ng\xfcr, Chen'}, '_id': '4mlln04q1rxy6l9oeb3t7ftv', 'type': 'item', 'aliases': {'url': ['http://linkinghub.elsevier.com/retrieve/pii/S0278262611001308', 'http://www.ncbi.nlm.nih.gov/pubmed/21872380'], 'pmid': ['21872380'], 'doi': ['10.1016/j.bandc.2011.08.003'], 'title': ['Perceptual training strongly improves visual motion perception in schizophrenia']}} + item = {'created': '2012-08-23T14:40:16.399932', '_rev': '6-3e0ede6e797af40860e9dadfb39056ce', 'last_modified': '2012-08-23T14:40:16.399932', 'biblio': {'title': 'Perceptual training strongly improves visual motion perception in schizophrenia', 'journal': 'Brain and Cognition', 'year': 2011, 'authors': u'Norton, McBain, \xd6ng\xfcr, Chen'}, '_id': '4mlln04q1rxy6l9oeb3t7ftv', 'type': 'item', 'aliases': {'url': ['http://linkinghub.elsevier.com/retrieve/pii/S0278262611001308', 'http://www.ncbi.nlm.nih.gov/pubmed/21872380'], 'pmid': ['21872380'], 'doi': ['10.1016/j.bandc.2011.08.003'], 'title': ['Perceptual training strongly improves visual motion perception in schizophrenia']}} metrics_method_response = (2, 'http://api.mendeley.com/research/perceptual-training-strongly-improves-visual-motion-perception-schizophrenia/') response = models.ItemFactory.add_metrics_data("mendeley:readers", metrics_method_response, item) print response @@ -233,7 +233,7 @@ def add_metrics_data(self): 'aliases': {'url': ['http://linkinghub.elsevier.com/retrieve/pii/S0278262611001308', 'http://www.ncbi.nlm.nih.gov/pubmed/21872380'], 'pmid': ['21872380'], 'doi': ['10.1016/j.bandc.2011.08.003'], 'title': ['Perceptual training strongly improves visual motion perception in schizophrenia']}, '_id': '4mlln04q1rxy6l9oeb3t7ftv', '_rev': '6-3e0ede6e797af40860e9dadfb39056ce', 'biblio': {'authors': u'Norton, McBain, \xd6ng\xfcr, Chen', 'journal': 'Brain and Cognition', 'year': 2011, 'title': 'Perceptual training strongly improves visual motion perception in schizophrenia'}, - 'type': 'item', 'providersWithMetricsCount': 11} + 'type': 'item'} assert_equals(response, expected) def test_is_currently_updating_unknown(self): diff --git a/test/unit_tests/test_views.py b/test/unit_tests/test_views.py index 3375399e..1987c697 100644 --- a/test/unit_tests/test_views.py +++ b/test/unit_tests/test_views.py @@ -60,11 +60,9 @@ def setUp(self): "_id": "1aff9dfebea711e1bdf912313d1a5e63", "_rev": "968-c7891982fca2ea41346a20b80c2b888d", "aliases": { - "created": "2012-06-25T09:21:11.960306", "doi": [ "10.5061/dryad.j1fd7" ], - "last_modified": "2012-07-29T02:00:29.001625", "title": [ "Data from: Data archiving is a good use of research funds", "data from: data archiving is a good investment" @@ -117,20 +115,6 @@ def setUp(self): } } }, - "providersRunCounter": 10, - "providersWithMetricsCount": 10, - "providers_run": [ - "Slideshare", - "Github", - "Plosalm", - "Facebook", - "Topsy", - "Citeulike", - "Wikipedia", - "Delicious", - "Mendeley", - "Dryad" - ], "type": "item" } '''