Moves removing of 'id' to endecoder where it belongs.
This commit is contained in:
parent
e1ae125916
commit
c9e4f9788c
@ -100,6 +100,9 @@ class EnDecoder(object):
|
||||
def _decode_bibdata(self, bibdata_stream):
|
||||
try:
|
||||
entries = bp.bparser.BibTexParser(bibdata_stream, customization=customizations).get_entry_dict()
|
||||
# Remove 'id' attribute which is stored as citekey
|
||||
for e in entries:
|
||||
entries[e].pop('id')
|
||||
if len(entries) > 0:
|
||||
return entries
|
||||
except Exception:
|
||||
|
@ -24,8 +24,6 @@ class Paper(object):
|
||||
self.bibdata = bibdata
|
||||
|
||||
_, self.bibentry = bibstruct.get_entry(self.bibdata)
|
||||
if 'id' in self.bibentry:
|
||||
self.bibentry.pop('id')
|
||||
|
||||
if self.metadata is None:
|
||||
self.metadata = copy.deepcopy(DEFAULT_META)
|
||||
|
@ -43,7 +43,6 @@ class TestPushPaper(TestRepo):
|
||||
orig = fixtures.doe_bibdata
|
||||
self.repo.push_paper(Paper(orig))
|
||||
retrieved = self.repo.databroker.pull_bibdata('Doe2013')
|
||||
retrieved['Doe2013'].pop('id')
|
||||
self.assertEquals(orig, retrieved)
|
||||
|
||||
def test_pushes_paper_metadata(self):
|
||||
|
@ -46,6 +46,8 @@ class TestFakeInput(unittest.TestCase):
|
||||
class CommandTestCase(unittest.TestCase):
|
||||
"""Abstract TestCase intializing the fake filesystem."""
|
||||
|
||||
maxDiff = None
|
||||
|
||||
def setUp(self):
|
||||
self.fs = fake_env.create_fake_fs([content, filebroker, init_cmd, import_cmd])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user