Fix undefined variable and remove 'added' time (set by repo.push_paper).
This commit is contained in:
parent
aedc59cf91
commit
ed16f0bb5b
@ -1,5 +1,3 @@
|
|||||||
import datetime
|
|
||||||
|
|
||||||
from ..uis import get_ui
|
from ..uis import get_ui
|
||||||
from ..configs import config
|
from ..configs import config
|
||||||
from .. import bibstruct
|
from .. import bibstruct
|
||||||
@ -86,14 +84,13 @@ def command(args):
|
|||||||
else:
|
else:
|
||||||
rp.databroker.exists(citekey, both=False)
|
rp.databroker.exists(citekey, both=False)
|
||||||
|
|
||||||
|
p = paper.Paper(bibdata, citekey=citekey)
|
||||||
|
|
||||||
# tags
|
# tags
|
||||||
|
|
||||||
if tags is not None:
|
if tags is not None:
|
||||||
p.tags = set(tags.split(','))
|
p.tags = set(tags.split(','))
|
||||||
|
|
||||||
p = paper.Paper(bibdata, citekey=citekey)
|
|
||||||
p.added = datetime.datetime.now()
|
|
||||||
|
|
||||||
# document file
|
# document file
|
||||||
|
|
||||||
bib_docfile = bibstruct.extract_docfile(bibdata)
|
bib_docfile = bibstruct.extract_docfile(bibdata)
|
||||||
|
@ -341,6 +341,14 @@ class TestUsecase(DataCommandTestCase):
|
|||||||
with self.assertRaises(SystemExit):
|
with self.assertRaises(SystemExit):
|
||||||
self.execute_cmds(cmds)
|
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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user