def test_dc_process_search_non_speech_events_multiple_instances_both_over(self): '''ensure we can locate multiple non speech events, one instance is bad''' test_limit_1='[%s]'%('a'*21) test_limit_2='[%s]'%('b'*21) test_string = 'recording_7.wav %sWow that is %s awesome' % (test_limit_1,test_limit_2) print('...test string >>%s' % test_string) tst_dc = DataClean(contents=test_string) self.assertTrue(tst_dc._search_non_speech_events(),'...expected to be under the limit, confirm')
def test_dc_process_search_non_speech_events_at_limit(self): '''ensure that one the limit will still pass (as False)''' test_limit='[%s]'%('a'*20) test_string = 'recording_7.wav %sWow that is awesome' % test_limit print('...test string >>%s' % test_string) tst_dc = DataClean(contents=test_string) self.assertFalse(tst_dc._search_non_speech_events(),'...expected at limit of 20 chars, confirm')
def test_dc_process_search_non_speech_events_over_limit(self): '''ensure that OVER the limit will still fail (as True)''' test_limit='[%s]'%('a'*30) test_string = 'recording_7.wav %sWow that is awesome' % test_limit print('...test string >>%s' % test_string) tst_dc = DataClean(contents=test_string) self.assertTrue(tst_dc._search_non_speech_events(),'...expected to be over the limit of 20 chars, confirm')
def test_dc_process_search_non_speech_events_nochars(self): '''make sure we can find the non speech with no chars event and ensure it's under the limit''' test_limit='[]' test_string = 'recording_7.wav %sWow that is awesome' % test_limit print('...test string >>%s' % test_string) tst_dc = DataClean(contents=test_string) self.assertFalse(tst_dc._search_non_speech_events(),'...expected to within limit, confirm')