-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestReadSmallTextBot.py
More file actions
31 lines (27 loc) · 1.3 KB
/
testReadSmallTextBot.py
File metadata and controls
31 lines (27 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import unittest
import readsSmallTextBot
class TestReadsSmallTextBot(unittest.TestCase):
def test_get_suped(self):
r = readsSmallTextBot.get_suped('A test^^^comment for testing')
self.assertItemsEqual(r, ['comment'])
r = readsSmallTextBot.get_suped('No small text')
self.assertItemsEqual(r, [])
r = readsSmallTextBot.get_suped('A multi\nline ^^^comment')
self.assertItemsEqual(r, ['comment'])
r = readsSmallTextBot.get_suped('Only^really^small text^^should be^found^by^this^bot')
self.assertItemsEqual(r, ['this bot'])
r = readsSmallTextBot.get_suped('A test^^^comment for^^testing^this^bot')
self.assertItemsEqual(r, ['comment this bot'])
r = readsSmallTextBot.get_suped('A test^^^comment ^^^testing')
self.assertItemsEqual(r, ['comment testing'])
r = readsSmallTextBot.get_suped('A test^^^comment\n^^^testing')
self.assertItemsEqual(r, ['comment', 'testing'])
r = readsSmallTextBot.get_suped('test^^^ಠ⏝ಠ')
self.assertItemsEqual(r, ['ಠ⏝ಠ'])
def test_build_comment(self):
r = readsSmallTextBot.build_comment(['comment'])
self.assertEquals('>comment', r)
r = readsSmallTextBot.build_comment(['comment', 'this bot'])
self.assertEquals('>comment\n\n>this bot', r)
if __name__ == '__main__':
unittest.main()