def test_cleanup_without_delete(self, shutil_mock): options = MagicMock() options.no_delete = True with open(os.devnull, 'w') as sys.stderr: cleanup(options, "/tmp") self.assertEqual(shutil_mock.rmtree.call_args_list, [])
def test_cleanup_delete(self, shutil_mock): options = MagicMock() options.no_delete = False cleanup(options, "/tmp") self.assertEqual( shutil_mock.rmtree.call_args_list, [call('/tmp')] )
def test_cleanup_delete(self, shutil_mock): options = MagicMock() options.no_delete = False cleanup(options, "/tmp") self.assertEqual(shutil_mock.rmtree.call_args_list, [call('/tmp')])