示例#1
0
    def test_successfully(self, mock_umount, mock_exists):
        '''Tests calling NfsBroker.cleanup_upload_dir() successfully'''

        def new_exists(path):
            return True
        mock_exists.side_effect = new_exists

        upload_dir = os.path.join('the', 'upload', 'dir')
        work_dir = os.path.join('the', 'work', 'dir')

        # Call method to test
        broker = NfsBroker()
        broker.cleanup_upload_dir(upload_dir, work_dir)

        # Check results
        mock_umount.assert_called_once_with(work_dir)