diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/bibexamples/leadingspace.bib b/tests/bibexamples/leadingspace.bib new file mode 100644 index 0000000..ebe863e --- /dev/null +++ b/tests/bibexamples/leadingspace.bib @@ -0,0 +1,4 @@ +@article{ Space, + author = {Name, FirstName}, + title = {Title}, +} diff --git a/tests/data/utf8.bib b/tests/bibexamples/utf8.bib similarity index 100% rename from tests/data/utf8.bib rename to tests/bibexamples/utf8.bib diff --git a/tests/test_usecase.py b/tests/test_usecase.py index 5bc1ed4..abcb1a1 100644 --- a/tests/test_usecase.py +++ b/tests/test_usecase.py @@ -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):