From 730c84e5e575488afb6a0b042582737f3fc2b2ea Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 10 Jun 2017 20:24:45 -0400 Subject: [PATCH] Correct tests for export mode The old tests were wrong but the incorrectness was hidden by the incorrect parameter passing fixed in the previous commit. Now we actually test that the item's path did not change. --- test/test_ui.py | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/test/test_ui.py b/test/test_ui.py index a24a635f3..ed31570e4 100644 --- a/test/test_ui.py +++ b/test/test_ui.py @@ -501,36 +501,23 @@ class ExportTest(_common.TestCase): commands.move_items(self.lib, dest, query, copy, album, pretend, export=export) - def test_export_item(self): - self._move() - self.i.load() - self.assertTrue(b'testlibdir' in self.i.path) - self.assertExists(self.i.path) - self.assertNotExists(self.itempath) - def test_export_item_custom_dir(self): self._move(dest=self.otherdir) self.i.load() - self.assertTrue(b'testotherdir' in self.i.path) - self.assertExists(self.i.path) - self.assertNotExists(self.itempath) + self.assertEqual(self.i.path, self.itempath) + self.assertExists(self.otherdir) def test_export_album_custom_dir(self): self._move(dest=self.otherdir, album=True) self.i.load() - self.assertTrue(b'testotherdir' in self.i.path) - self.assertExists(self.i.path) - self.assertNotExists(self.itempath) + self.assertEqual(self.i.path, self.itempath) + self.assertExists(self.otherdir) def test_pretend_export_item(self): self._move(dest=self.otherdir, pretend=True) self.i.load() self.assertIn(b'srcfile', self.i.path) - - def test_pretend_export_album(self): - self._move(album=True, pretend=True) - self.i.load() - self.assertIn(b'srcfile', self.i.path) + self.assertNotExists(self.otherdir) class UpdateTest(_common.TestCase):