mirror of
https://codeberg.org/privacy1st/exec-notify
synced 2024-12-22 23:16:04 +01:00
31 lines
794 B
Python
31 lines
794 B
Python
|
import unittest
|
||
|
|
||
|
import de.p1st.exec_notify.lib.util as util
|
||
|
|
||
|
|
||
|
class MyTestCase(unittest.TestCase):
|
||
|
def test1_appendLinePrefix(self):
|
||
|
s = "This is a sentence.\nAnd this a second line."
|
||
|
|
||
|
expected = "PREFIX This is a sentence.\nPREFIX And this a second line."
|
||
|
actual = util.appendLinePrefix("PREFIX ", s)
|
||
|
self.assertEqual(expected, actual)
|
||
|
|
||
|
def test2_appendLinePrefix(self):
|
||
|
s = "\n"
|
||
|
|
||
|
expected = "PREFIX \nPREFIX "
|
||
|
actual = util.appendLinePrefix("PREFIX ", s)
|
||
|
self.assertEqual(expected, actual)
|
||
|
|
||
|
def test3_appendLinePrefix(self):
|
||
|
s = ""
|
||
|
|
||
|
expected = "PREFIX "
|
||
|
actual = util.appendLinePrefix("PREFIX ", s)
|
||
|
self.assertEqual(expected, actual)
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
unittest.main()
|