alessandro trinca tornidor commited on
Commit
9b75ad3
1 Parent(s): b36b551

test: update tests for python 3.10

Browse files
tests/test_GetAccuracyFromRecordedAudio.py CHANGED
@@ -31,6 +31,8 @@ class TestGetAccuracyFromRecordedAudio(unittest.TestCase):
31
  output = json.loads(output)
32
  assert len(output["matched_transcripts"].strip()) > 0
33
  assert len(output["matched_transcripts_ipa"].strip()) > 0
 
 
34
  output = check_output_by_field(output, "is_letter_correct_all_words", '[01]+', expected_output)
35
  output = check_output_by_field(output, "end_time", '\d+\.\d+', expected_output)
36
  output = check_output_by_field(output, "start_time", '\d+\.\d+', expected_output)
@@ -38,6 +40,8 @@ class TestGetAccuracyFromRecordedAudio(unittest.TestCase):
38
  output["matched_transcripts"] = expected_output["matched_transcripts"]
39
  output["matched_transcripts_ipa"] = expected_output["matched_transcripts_ipa"]
40
  output["pronunciation_accuracy"] = expected_output["pronunciation_accuracy"]
 
 
41
  self.assertEqual(expected_output, output)
42
 
43
 
 
31
  output = json.loads(output)
32
  assert len(output["matched_transcripts"].strip()) > 0
33
  assert len(output["matched_transcripts_ipa"].strip()) > 0
34
+ assert len(output["ipa_transcript"].strip()) > 0
35
+ assert len(output["real_transcripts_ipa"].strip()) > 0
36
  output = check_output_by_field(output, "is_letter_correct_all_words", '[01]+', expected_output)
37
  output = check_output_by_field(output, "end_time", '\d+\.\d+', expected_output)
38
  output = check_output_by_field(output, "start_time", '\d+\.\d+', expected_output)
 
40
  output["matched_transcripts"] = expected_output["matched_transcripts"]
41
  output["matched_transcripts_ipa"] = expected_output["matched_transcripts_ipa"]
42
  output["pronunciation_accuracy"] = expected_output["pronunciation_accuracy"]
43
+ output["ipa_transcript"] = expected_output["ipa_transcript"]
44
+ output["real_transcripts_ipa"] = expected_output["real_transcripts_ipa"]
45
  self.assertEqual(expected_output, output)
46
 
47
 
tests/test_phonem_converter_score.py CHANGED
@@ -17,7 +17,7 @@ class TestPhonemConverter(unittest.TestCase):
17
  deu_latn = epitran.Epitran('deu-Latn')
18
  phonem_converter = RuleBasedModels.EpitranPhonemConverter(deu_latn)
19
  output = phonem_converter.convertToPhonem('Hallo, das ist ein Test')
20
- self.assertEqual(output, 'haloː, dɑːs ɪst ain tɛst')
21
 
22
 
23
  trainer_SST_lambda = {'de': pronunciationTrainer.getTrainer("de")}
 
17
  deu_latn = epitran.Epitran('deu-Latn')
18
  phonem_converter = RuleBasedModels.EpitranPhonemConverter(deu_latn)
19
  output = phonem_converter.convertToPhonem('Hallo, das ist ein Test')
20
+ self.assertEqual(output, 'haloː, daːs ɪst aɪ̯n tɛst')
21
 
22
 
23
  trainer_SST_lambda = {'de': pronunciationTrainer.getTrainer("de")}