예제 #1
0
 def test_firstline(self):
     "Test firstline"
     for text, result in [
         ("", ""),
         ("first line\nsecond line", "first line"),
         ("\nsecond line", "second line"),
         ("\n\nthird line", "third line"),
         (" \nsecond line", "second line"),
     ]:
         with self.subTest(text=text, result=result):
             self.assertEqual(firstline(text), result)
예제 #2
0
파일: error.py 프로젝트: zarumaru/trytond
 def on_change_with_summary(self, name=None):
     return firstline(self.message or '')
예제 #3
0
 def on_change_with_summary(self, name=None):
     return firstline(self.description or '')