Skip to content

Commit

Permalink
Merge branch 'master' of github.com:okfn/bibserver
Browse files Browse the repository at this point in the history
  • Loading branch information
epoz committed Jun 27, 2012
2 parents 28c6971 + 669ea8b commit 1fd48ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions parserscrapers_plugins/bibtex.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ def string_subst(self, val):
parts = val.split(str(v))
for key,val in enumerate(parts):
if key+1 < len(parts) and len(parts[key+1]) > 0:
parts[key] = parts[key] + parts[key+1][0]
parts[key+1] = parts[key+1][1:]
parts[key+1] = parts[key+1][0:]
val = k.join(parts)
val = val.replace("{","").replace("}","")
return val
Expand Down
7 changes: 4 additions & 3 deletions test/test_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_bibtex_missing_comma(self):
def test_bibtex_keywords(self):
inp_data = '''@misc{Morgan2011,
author = {Morgan, J. T. and Geiger, R. S. and Pinchuk, M. and Walker, S.},
keywords = {open\_access, wrn2011, wrn201107},
keywords = {open\_access, wrn2011, wrn201107, thing\#withhash},
title = {{This is a test}},
year = {2011}
}
Expand All @@ -133,7 +133,8 @@ def test_bibtex_keywords(self):
data = p.communicate(input=inp_data)[0]
data = json.loads(data)
assert 'keyword' in data['records'][0]
assert u'open_access' in data['records'][0].get('keyword')
assert u'open_access' in data['records'][0].get('keyword'), data['records'][0].get('keyword')
assert u'thing#withhash' in data['records'][0].get('keyword'), data['records'][0].get('keyword')

def test_csv(self):
p = ingest.PLUGINS.get('csv')
Expand Down Expand Up @@ -212,4 +213,4 @@ def test_json_01(self):

def test_plugin_dump(self):
plugins = ingest.get_plugins()
assert len(plugins.keys()) > 0
assert len(plugins.keys()) > 0

0 comments on commit 1fd48ad

Please sign in to comment.