コード例 #1
0
    def test_successful_removal(self, mock_rmtree):
        # Setup
        test_dir = '/test/dir'

        # Test
        export_utils.cleanup_working_dir(test_dir)
        mock_rmtree.assert_called_once_with(test_dir)
コード例 #2
0
    def test_failed_removal(self, mock_rmtree):
        # Setup
        mock_rmtree.side_effect = OSError('boop')

        # Test
        try:
            export_utils.cleanup_working_dir('/somedir')
        except OSError:
            self.fail('cleanup_working_dir should not raise an exception when rmtree fails')