Fix undefined variable and remove 'added' time (set by repo.push_paper).

main
Olivier Mangin 11 years ago
parent aedc59cf91
commit ed16f0bb5b

@ -1,5 +1,3 @@
import datetime
from ..uis import get_ui
from ..configs import config
from .. import bibstruct
@ -86,14 +84,13 @@ def command(args):
else:
rp.databroker.exists(citekey, both=False)
p = paper.Paper(bibdata, citekey=citekey)
# tags
if tags is not None:
p.tags = set(tags.split(','))
p = paper.Paper(bibdata, citekey=citekey)
p.added = datetime.datetime.now()
# document file
bib_docfile = bibstruct.extract_docfile(bibdata)

@ -341,6 +341,14 @@ class TestUsecase(DataCommandTestCase):
with self.assertRaises(SystemExit):
self.execute_cmds(cmds)
def test_add_with_tag(self):
cmds = ['pubs init',
'pubs add data/pagerank.bib --tags junk',
'pubs tag junk'
]
outs = self.execute_cmds(cmds)
self.assertEqual(1, len(outs[2].splitlines()))
if __name__ == '__main__':
unittest.main()

Loading…
Cancel
Save