main
Fabien C. Y. Benureau 7 years ago
parent efb91b1ff4
commit a58f1b1d5e
No known key found for this signature in database
GPG Key ID: C3FB5E831A249A9A

@ -16,6 +16,10 @@ def command(conf, args):
papers = list(rp.all_papers())
paper_count = len(papers)
if paper_count == 0:
ui.message('Your pubs repository is empty.')
else:
doc_count = sum([0 if p.docpath is None else 1 for p in papers])
tag_count = len(list(rp.get_tags()))
papers_with_tags = sum([0 if p.tags else 1 for p in papers])

@ -984,6 +984,7 @@ class TestUsecase(DataCommandTestCase):
def test_statistics(self):
cmds = ['pubs init',
'pubs statistics',
'pubs add data/pagerank.bib',
'pubs add -d data/turing-mind-1950.pdf data/turing1950.bib',
'pubs add data/martius.bib',
@ -993,6 +994,8 @@ class TestUsecase(DataCommandTestCase):
'pubs statistics',
]
out = self.execute_cmds(cmds)
lines = out[1].splitlines()
self.assertEqual(lines[0], 'Your pubs repository is empty.')
lines = out[-1].splitlines()
self.assertEqual(lines[0], 'Repository statistics:')
self.assertEqual(lines[1], 'Total papers: 4, 1 (25%) have a document attached')

Loading…
Cancel
Save