Skip to content

Commit

Permalink
fix documentation to remove providerRunCounter etc
Browse files Browse the repository at this point in the history
  • Loading branch information
hpiwowar committed Dec 10, 2012
1 parent 6695cda commit d09824b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 42 deletions.
2 changes: 0 additions & 2 deletions apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ GET /v1/item/github/egonw,cdk?key=YOURKEY
}
}
},
"providersWithMetricsCount": 10,
"type": "item"
}
Expand Down Expand Up @@ -610,7 +609,6 @@ GET /v1/item/url/http://www.slideshare.net/cavlec/who-owns-our-work?key=YOURKEY
}
}
},
"providersWithMetricsCount": 11,
"type": "item"
}
Expand Down
6 changes: 0 additions & 6 deletions extras/couch_maint.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@

logger = logging.getLogger("couch_maint")

# hardcode it
#cloudant_url = "http://app5109761.heroku:[email protected]" #production
#cloudant_url = "http://app5492954.heroku:[email protected]" #staging
#cloudant_db = "heather_ti"
#cloudant_db = "ti"

cloudant_db = os.getenv("CLOUDANT_DB")
cloudant_url = os.getenv("CLOUDANT_URL")

Expand Down
14 changes: 0 additions & 14 deletions scratchpad.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,5 @@
}
},
},
"providersRunCounter": 10,
"providersWithMetricsCount": 10,
"providers_run": [
"Slideshare",
"Github",
"Plosalm",
"Facebook",
"Topsy",
"Citeulike",
"Wikipedia",
"Delicious",
"Mendeley",
"Dryad"
],
"type": "item"
}
8 changes: 4 additions & 4 deletions test/unit_tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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):
Expand Down
16 changes: 0 additions & 16 deletions test/unit_tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
}
'''
Expand Down

0 comments on commit d09824b

Please sign in to comment.