Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Summer School Data Organization Code #56

Merged
merged 36 commits into from
Jun 12, 2024
Merged

Add Summer School Data Organization Code #56

merged 36 commits into from
Jun 12, 2024

Conversation

ibevers
Copy link
Contributor

@ibevers ibevers commented Jun 12, 2024

No description provided.

ibevers and others added 30 commits May 24, 2024 11:23
@pytest.fixture
def mock_file_system():
    with mock.patch('os.listdir') as mock_listdir, \
         mock.patch('os.path.isdir') as mock_isdir, \
         mock.patch('os.path.exists') as mock_exists, \
         mock.patch('os.path.isfile') as mock_isfile:
        # Mock the directory structure
        def listdir_side_effect(path):
            if path == 'mock_bids_dir_path':
                return ['sub-1']
            elif path == 'mock_bids_dir_path/sub-1':
                return ['ses-1', 'ses-2']
            elif path == 'mock_bids_dir_path/sub-1/ses-1':
                return []
            elif path == 'mock_bids_dir_path/sub-1/ses-2':
                return ['audio-1.wav', 'otherfile.txt']
            return []

        def isdir_side_effect(path):
            return path in [
                'mock_bids_dir_path',
                'mock_bids_dir_path/sub-1',
                'mock_bids_dir_path/sub-1/ses-1',
                'mock_bids_dir_path/sub-1/ses-2'
            ]

        def exists_side_effect(path):
            return path in [
                'mock_bids_dir_path',
                'mock_bids_dir_path/sub-1',
                'mock_bids_dir_path/sub-1/ses-1',
                'mock_bids_dir_path/sub-1/ses-2',
                'mock_bids_dir_path/sub-1/ses-2/audio-1.wav',
                'mock_bids_dir_path/sub-1/ses-2/otherfile.txt'
            ]

        def isfile_side_effect(path):
            return path in [
                'mock_bids_dir_path/sub-1/ses-2/audio-1.wav',
                'mock_bids_dir_path/sub-1/ses-2/otherfile.txt'
            ]

        mock_listdir.side_effect = listdir_side_effect
        mock_isdir.side_effect = isdir_side_effect
        mock_exists.side_effect = exists_side_effect
        mock_isfile.side_effect = isfile_side_effect
        yield
@ibevers ibevers merged commit f6408c7 into main Jun 12, 2024
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants