def test_implicit_stim_conversion(): image_dir = join(get_test_data_path(), 'image') stim = ImageStim(join(image_dir, 'button.jpg')) ext = LengthExtractor() result = ext.extract(stim).to_df() assert 'text_length' in result.columns assert result['text_length'][0] == 4
def test_implicit_stim_conversion2(): audio_dir = join(get_test_data_path(), 'audio') stim = AudioStim(join(audio_dir, 'homer.wav')) ext = LengthExtractor() result = ext.extract(stim) first_word = result[0].to_df() assert 'text_length' in first_word.columns assert first_word['text_length'][0] > 0
def test_text_length_extractor(): stim = TextStim(text='hello world') ext = LengthExtractor() result = ext.extract(stim).to_df() assert 'text_length' in result.columns assert result['text_length'][0] == 11