Test for leading space in citekeys
This test is expected to fail. Nose does not handle that yet (treats it as false). As such, changes have been made to make tests discoverable by unittest. You may want to uninstall nose and do something like: alias nosetests="python -m unittest discover" in your bashrc Related: #25
This commit is contained in:
parent
0ab8310089
commit
3b0ba0bb3c
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
4
tests/bibexamples/leadingspace.bib
Normal file
4
tests/bibexamples/leadingspace.bib
Normal file
@ -0,0 +1,4 @@
|
||||
@article{ Space,
|
||||
author = {Name, FirstName},
|
||||
title = {Title},
|
||||
}
|
@ -121,6 +121,7 @@ class DataCommandTestCase(CommandTestCase):
|
||||
def setUp(self):
|
||||
super(DataCommandTestCase, self).setUp()
|
||||
fake_env.copy_dir(self.fs, os.path.join(os.path.dirname(__file__), 'data'), 'data')
|
||||
fake_env.copy_dir(self.fs, os.path.join(os.path.dirname(__file__), 'bibexamples'), 'bibexamples')
|
||||
|
||||
|
||||
# Actual tests
|
||||
@ -174,7 +175,7 @@ class TestAdd(DataCommandTestCase):
|
||||
"utf-8 citekeys are not supported yet.\n"
|
||||
"See https://github.com/pubs/pubs/issues/28 for details.") # actually not checked
|
||||
cmds = ['pubs init',
|
||||
('pubs add /data/utf8.bib', [], '', err),
|
||||
('pubs add /bibexamples/utf8.bib', [], '', err),
|
||||
]
|
||||
with self.assertRaises(SystemExit):
|
||||
self.execute_cmds(cmds)
|
||||
@ -203,6 +204,16 @@ class TestAdd(DataCommandTestCase):
|
||||
with self.assertRaises(SystemExit):
|
||||
self.execute_cmds(cmds)
|
||||
|
||||
@unittest.expectedFailure
|
||||
def test_leading_citekey_space(self):
|
||||
cmds = ['pubs init',
|
||||
'pubs add /data/leadingspace.bib',
|
||||
'pubs rename LeadingSpace NoLeadingSpace',
|
||||
]
|
||||
self.execute_cmds(cmds)
|
||||
|
||||
|
||||
|
||||
|
||||
class TestList(DataCommandTestCase):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user