zaidmehdi commited on
Commit
172e713
1 Parent(s): 9365c1c

update tests

Browse files
Files changed (1) hide show
  1. tests/model_tests.py +6 -7
tests/model_tests.py CHANGED
@@ -18,19 +18,18 @@ class TestClassifier(unittest.TestCase):
18
  def test_response(self):
19
  """Test if the response of the main function is correct"""
20
  text = "حاجة حلوة اكيد"
21
- predictions, probabilities = classify_arabic_dialect(text)
22
  self.assertEqual(len(predictions), 3)
23
- self.assertEqual(len(probabilities), 3)
24
  for i in range(3):
25
- self.assertIn(predictions[i], self.dialects)
26
- self.assertGreaterEqual(probabilities[i], 0)
27
- self.assertLessEqual(probabilities[i], 1)
28
 
29
  def test_model_output(self):
30
  """Test that the model correctly classifies obvious dialects"""
31
  for country, text, in self.test_set.items():
32
- predictions, _ = classify_arabic_dialect(text)
33
- self.assertEqual(predictions[0], country)
34
 
35
 
36
  if __name__ == "__main__":
 
18
  def test_response(self):
19
  """Test if the response of the main function is correct"""
20
  text = "حاجة حلوة اكيد"
21
+ predictions = classify_arabic_dialect(text)
22
  self.assertEqual(len(predictions), 3)
 
23
  for i in range(3):
24
+ self.assertIn(predictions[i][0], self.dialects)
25
+ self.assertGreaterEqual(predictions[i][1], 0)
26
+ self.assertLessEqual(predictions[i][1], 1)
27
 
28
  def test_model_output(self):
29
  """Test that the model correctly classifies obvious dialects"""
30
  for country, text, in self.test_set.items():
31
+ first_prediction, _, _ = classify_arabic_dialect(text)
32
+ self.assertEqual(first_prediction[0], country)
33
 
34
 
35
  if __name__ == "__main__":