Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

message_test.py 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import million.analyze.message_evaluation as msg_val
  2. from test.TestCase import TestCase
  3. class MessageTest(TestCase):
  4. def test_single_digit(self, overrides=None, exclude=None):
  5. message = self._message_with_text("1")
  6. assert 1 == msg_val.get(message)
  7. def test_nothing(self, overrides=None, exclude=None):
  8. message = self._message_with_text("")
  9. assert None == msg_val.get(message)
  10. def test_message_nominal(self, overrides=None, exclude=None):
  11. message = self._message_with_text("1234")
  12. assert 1234 == msg_val.get(message)
  13. def test_message_with_text(self, overrides=None, exclude=None):
  14. message = self._message_with_text("... 😏😏 269")
  15. assert 269 == msg_val.get(message)
  16. def test_message_with_text_2(self, overrides=None, exclude=None):
  17. message = self._message_with_text("331 allez la")
  18. assert 331 == msg_val.get(message)
  19. def test_message_with_text_3(self, overrides=None, exclude=None):
  20. message = self._message_with_text("Ok 2160")
  21. assert 2160 == msg_val.get(message)
  22. def test_message_value_cut(self, overrides=None, exclude=None):
  23. message = self._message_with_text("66...😏😏😏9")
  24. assert 669 == msg_val.get(message)
  25. def test_message_value_cut_2(self, overrides=None, exclude=None):
  26. message = self._message_with_text("82heyyyyyy69")
  27. assert 8269 == msg_val.get(message)
  28. def test_message_value_cut_2(self, overrides=None, exclude=None):
  29. message = self._message_with_text("9339 9339 9339 9339")
  30. assert 9339 == msg_val.get(message)
  31. def test_message_in_middle(self, overrides=None, exclude=None):
  32. message = self._message_with_text("A peine 5565 ouais...")
  33. assert 5565 == msg_val.get(message)
  34. def test_message_float_1(self, overrides=None, exclude=None):
  35. message = self._message_with_text("11111,1111111111111111¼")
  36. assert 11111 == msg_val.get(message)