diff options
| author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-12-29 10:17:11 +0100 | 
|---|---|---|
| committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-12-29 10:18:10 +0100 | 
| commit | bd5a6fe58cd739ea7d36cc9d37730adc4f688025 (patch) | |
| tree | 3f6dade91331e0eb0a4a1ff50661d1dd37f18cbe /tests | |
| parent | d40cc993c199f58031cb4f25b9f9b21ac3b0bafe (diff) | |
Fix rm command test (and others) by indexing the collection at the beginning
Diffstat (limited to 'tests')
| -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  | 
