diff options
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r-- | tests/test_commands.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py index 91a8894..2f3fa8c 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -47,6 +47,13 @@ class testCommandsSimple(unittest.TestCase, CommandsMixin): self.tmpdir.name, dirs_exist_ok=True, ) + # re-index the collection before running each test + args = { + 'collection': self.tmpdir.name, + "files": None, + "reset": True, + } + self._run_command(command.Index(), args) def tearDown(self): pass @@ -163,11 +170,20 @@ class testCommandsSimple(unittest.TestCase, CommandsMixin): args = { 'collection': self.tmpdir.name, 'git': True, - 'entries': '11189ee4', + 'entries': ['11189ee4'], } streams = self._run_command(command.Remove(), args) self.assertEqual(streams['stdout'].getvalue(), '') self.assertEqual(streams['stderr'].getvalue(), '') + # and check that the entry has been removed + args = { + 'collection': self.tmpdir.name, + 'git': True, + 'eid': '11189ee4', + 'template': False, + } + streams = self._run_command(command.Show(), args) + self.assertEqual(streams['stderr'].getvalue(), '') def test_update(self): args = { @@ -190,6 +206,13 @@ class testCommandsComplex(unittest.TestCase, CommandsMixin): self.tmpdir.name, dirs_exist_ok=True, ) + # re-index the collection before running each test + args = { + 'collection': self.tmpdir.name, + "files": None, + "reset": True, + } + self._run_command(command.Index(), args) def tearDown(self): pass |