Example #1
0
    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_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')]
     )
Example #4
0
 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')])